diff options
author | Jose Ivan Vargas <jvargas@gitlab.com> | 2017-02-17 01:02:40 +0300 |
---|---|---|
committer | Jose Ivan Vargas <jvargas@gitlab.com> | 2017-02-24 00:47:23 +0300 |
commit | 103f5a116b1ae6ecbef69d6903b26f7259f090cb (patch) | |
tree | 0e3d762be03e421a0f07a96c8ad94dc333724f89 /spec/features/user_callout_spec.rb | |
parent | 4802bd512a2492c7560acde077fee2f4cd9483b3 (diff) |
Created unit tests, fixtures and integration tests
Also changed the user_callout haml to a partial and
added the corresponding SVG icon
Diffstat (limited to 'spec/features/user_callout_spec.rb')
-rw-r--r-- | spec/features/user_callout_spec.rb | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/spec/features/user_callout_spec.rb b/spec/features/user_callout_spec.rb new file mode 100644 index 00000000000..9ab22475b5e --- /dev/null +++ b/spec/features/user_callout_spec.rb @@ -0,0 +1,37 @@ +require 'spec_helper' + +describe 'User Callouts', js: true do + let(:user) { create(:user) } + let(:project) { create(:empty_project, path: 'gitlab', name: 'sample') } + + before do + login_as(user) + project.team << [user, :master] + end + + 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 + + describe 'user callout should appear in two routes' do + it 'shows up on the user profile' do + visit user_path(user) + expect(find('#user-callout')).to have_content 'Customize your experience' + end + + it 'shows up on the dashboard projects' do + visit dashboard_projects_path + expect(find('#user-callout')).to have_content 'Customize your experience' + end + end + + it 'hides the user callout when click on the dismiss icon' do + visit user_path(user) + within('#user-callout') do + find('.dismiss-icon').click + end + expect(page).not_to have_selector('#user-callout') + end +end
\ No newline at end of file |