diff options
Diffstat (limited to 'features/steps/snippets/user.rb')
-rw-r--r-- | features/steps/snippets/user.rb | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/features/steps/snippets/user.rb b/features/steps/snippets/user.rb new file mode 100644 index 00000000000..2d7ffc866e7 --- /dev/null +++ b/features/steps/snippets/user.rb @@ -0,0 +1,41 @@ +class UserSnippets < Spinach::FeatureSteps + include SharedAuthentication + include SharedPaths + include SharedSnippet + + Given 'I visit my snippets page' do + visit user_snippets_path(current_user) + end + + Then 'I should see "Personal snippet one" in snippets' do + page.should have_content "Personal snippet one" + end + + And 'I should see "Personal snippet private" in snippets' do + page.should have_content "Personal snippet private" + end + + Then 'I should not see "Personal snippet one" in snippets' do + page.should_not have_content "Personal snippet one" + end + + And 'I should not see "Personal snippet private" in snippets' do + page.should_not have_content "Personal snippet private" + end + + Given 'I click "Public" filter' do + within('.nav-stacked') do + click_link "Public" + end + end + + Given 'I click "Private" filter' do + within('.nav-stacked') do + click_link "Private" + end + end + + def snippet + @snippet ||= PersonalSnippet.find_by!(title: "Personal snippet one") + end +end |