diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-06-10 22:27:06 +0200 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-06-10 22:27:06 +0200 |
commit | 95a10f4533fdb708c61ffda95099bddd94800f02 (patch) | |
tree | bf5c561472c47d34e5ff1f643c49cd2a6b206f15 /spec/features/dashboard/datetime_on_tooltips_spec.rb | |
parent | 17c6bec79d876ce932edc0edc5d17622adb2f724 (diff) | |
parent | b4e84809e8170a43126507da0bc6a3b94c33804b (diff) | |
download | gitlab-ce-95a10f4533fdb708c61ffda95099bddd94800f02.tar.gz |
Merge remote-tracking branch 'origin/master' into ci-lfs-fetch
Diffstat (limited to 'spec/features/dashboard/datetime_on_tooltips_spec.rb')
-rw-r--r-- | spec/features/dashboard/datetime_on_tooltips_spec.rb | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/spec/features/dashboard/datetime_on_tooltips_spec.rb b/spec/features/dashboard/datetime_on_tooltips_spec.rb new file mode 100644 index 00000000000..365cb445df1 --- /dev/null +++ b/spec/features/dashboard/datetime_on_tooltips_spec.rb @@ -0,0 +1,46 @@ +require 'spec_helper' + +feature 'Tooltips on .timeago dates', feature: true, js: true do + include WaitForAjax + + let(:user) { create(:user) } + let(:project) { create(:project, name: 'test', namespace: user.namespace) } + let(:created_date) { Date.yesterday.to_time } + let(:expected_format) { created_date.strftime('%b %-d, %Y %l:%M%P UTC') } + + context 'on the activity tab' do + before do + project.team << [user, :master] + + Event.create( project: project, author_id: user.id, action: Event::JOINED, + updated_at: created_date, created_at: created_date) + + login_as user + visit user_path(user) + wait_for_ajax() + + page.find('.js-timeago').hover + end + + it 'has the datetime formated correctly' do + expect(page).to have_selector('.local-timeago', text: expected_format) + end + end + + context 'on the snippets tab' do + before do + project.team << [user, :master] + create(:snippet, author: user, updated_at: created_date, created_at: created_date) + + login_as user + visit user_snippets_path(user) + wait_for_ajax() + + page.find('.js-timeago').hover + end + + it 'has the datetime formated correctly' do + expect(page).to have_selector('.local-timeago', text: expected_format) + end + end +end |