Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2017-03-24 15:41:42 +0300
committerPhil Hughes <me@iamphill.com>2017-03-24 19:36:23 +0300
commit3eedb2aede34165d7a34fa0dc77ed6c919f7dcb9 (patch)
treea5cb6e83b24b710a95711a8c3896a370c3bd4b23 /spec/features/user_callout_spec.rb
parent4a8e516c1fcdc2d5cb2b1cd2fcded382413d95f6 (diff)
Refactored the user callout class
Instead of the JS being in charge of the HTML, the HAML now handles it. The HAML can then check the cookie & show it needed. It also allows the HAML access to the paths so we don't have to pass that through. Closes #29955
Diffstat (limited to 'spec/features/user_callout_spec.rb')
-rw-r--r--spec/features/user_callout_spec.rb18
1 files changed, 15 insertions, 3 deletions
diff --git a/spec/features/user_callout_spec.rb b/spec/features/user_callout_spec.rb
index 659cd7c7af7..848af5e3a4d 100644
--- a/spec/features/user_callout_spec.rb
+++ b/spec/features/user_callout_spec.rb
@@ -7,15 +7,27 @@ describe 'User Callouts', js: true do
before do
login_as(user)
- project.team << [user, :master]
+ project.team << [user, :master]
end
- it 'takes you to the profile preferences when the link is clicked' do
+ it 'takes you to the profile preferences when the link is clicked' do
visit dashboard_projects_path
click_link 'Check it out'
expect(current_path).to eq profile_preferences_path
end
+ it 'does not show when cookie is set' do
+ visit dashboard_projects_path
+
+ within('.user-callout') do
+ find('.close').click
+ end
+
+ visit dashboard_projects_path
+
+ expect(page).not_to have_selector('.user-callout')
+ end
+
describe 'user callout should appear in two routes' do
it 'shows up on the user profile' do
visit user_path(user)
@@ -31,7 +43,7 @@ describe 'User Callouts', js: true do
it 'hides the user callout when click on the dismiss icon' do
visit user_path(user)
within('.user-callout') do
- find('.close-user-callout').click
+ find('.close').click
end
expect(page).not_to have_selector('.user-callout')
end