2014-09-22 10:30:25 -04:00
|
|
|
class Spinach::Features::UserSnippets < Spinach::FeatureSteps
|
2013-03-24 18:17:38 -04:00
|
|
|
include SharedAuthentication
|
|
|
|
include SharedPaths
|
2013-03-25 05:14:12 -04:00
|
|
|
include SharedSnippet
|
2013-03-24 18:17:38 -04:00
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'I visit my snippets page' do
|
2013-03-24 18:17:38 -04:00
|
|
|
visit user_snippets_path(current_user)
|
|
|
|
end
|
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'I should see "Personal snippet one" in snippets' do
|
2013-03-24 18:17:38 -04:00
|
|
|
page.should have_content "Personal snippet one"
|
|
|
|
end
|
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'I should see "Personal snippet private" in snippets' do
|
2013-03-24 18:17:38 -04:00
|
|
|
page.should have_content "Personal snippet private"
|
|
|
|
end
|
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'I should not see "Personal snippet one" in snippets' do
|
2013-03-24 18:17:38 -04:00
|
|
|
page.should_not have_content "Personal snippet one"
|
|
|
|
end
|
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'I should not see "Personal snippet private" in snippets' do
|
2013-03-24 18:17:38 -04:00
|
|
|
page.should_not have_content "Personal snippet private"
|
|
|
|
end
|
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'I click "Public" filter' do
|
2013-03-24 18:17:38 -04:00
|
|
|
within('.nav-stacked') do
|
|
|
|
click_link "Public"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'I click "Private" filter' do
|
2013-03-24 18:17:38 -04:00
|
|
|
within('.nav-stacked') do
|
|
|
|
click_link "Private"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def snippet
|
2014-01-19 13:55:59 -05:00
|
|
|
@snippet ||= PersonalSnippet.find_by!(title: "Personal snippet one")
|
2013-03-24 18:17:38 -04:00
|
|
|
end
|
|
|
|
end
|