diff options
author | Rémy Coutable <remy@rymai.me> | 2017-02-09 17:47:58 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-02-09 17:47:58 +0000 |
commit | 01e95b065e92d00fc46212177532dcfc819d5a29 (patch) | |
tree | ac36bfa6506baf1d5e348eee70ae22bbcc19bb5b /spec/features/snippets | |
parent | 75092d9647bab00070b0b77f0fe1050d900a39a1 (diff) | |
parent | 256a55d47be7838bbc061ddf9feb04b76e2a15ca (diff) | |
download | gitlab-ce-01e95b065e92d00fc46212177532dcfc819d5a29.tar.gz |
Merge branch 'move-user-snippets-spinach-test-to-rspec' into 'master'
Move 'User Snippets' Spinach feature to Rspec
See merge request !8574
Diffstat (limited to 'spec/features/snippets')
-rw-r--r-- | spec/features/snippets/user_snippets_spec.rb | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/spec/features/snippets/user_snippets_spec.rb b/spec/features/snippets/user_snippets_spec.rb new file mode 100644 index 00000000000..191c2fb9a22 --- /dev/null +++ b/spec/features/snippets/user_snippets_spec.rb @@ -0,0 +1,49 @@ +require 'rails_helper' + +feature 'User Snippets', feature: true do + let(:author) { create(:user) } + let!(:public_snippet) { create(:personal_snippet, :public, author: author, title: "This is a public snippet") } + let!(:internal_snippet) { create(:personal_snippet, :internal, author: author, title: "This is an internal snippet") } + let!(:private_snippet) { create(:personal_snippet, :private, author: author, title: "This is a private snippet") } + + background do + login_as author + visit dashboard_snippets_path + end + + scenario 'View all of my snippets' do + expect(page).to have_content(public_snippet.title) + expect(page).to have_content(internal_snippet.title) + expect(page).to have_content(private_snippet.title) + end + + scenario 'View my public snippets' do + page.within('.snippet-scope-menu') do + click_link "Public" + end + + expect(page).to have_content(public_snippet.title) + expect(page).not_to have_content(internal_snippet.title) + expect(page).not_to have_content(private_snippet.title) + end + + scenario 'View my internal snippets' do + page.within('.snippet-scope-menu') do + click_link "Internal" + end + + expect(page).not_to have_content(public_snippet.title) + expect(page).to have_content(internal_snippet.title) + expect(page).not_to have_content(private_snippet.title) + end + + scenario 'View my private snippets' do + page.within('.snippet-scope-menu') do + click_link "Private" + end + + expect(page).not_to have_content(public_snippet.title) + expect(page).not_to have_content(internal_snippet.title) + expect(page).to have_content(private_snippet.title) + end +end |