2014-10-02 12:42:54 -04:00
|
|
|
class Spinach::Features::SnippetsUser < 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
|
2015-09-08 09:49:20 -04:00
|
|
|
visit dashboard_snippets_path
|
2013-03-24 18:17:38 -04:00
|
|
|
end
|
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'I should see "Personal snippet one" in snippets' do
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(page).to have_content "Personal snippet one"
|
2013-03-24 18:17:38 -04:00
|
|
|
end
|
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'I should see "Personal snippet private" in snippets' do
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(page).to have_content "Personal snippet private"
|
2013-03-24 18:17:38 -04:00
|
|
|
end
|
|
|
|
|
2014-10-08 09:44:25 -04:00
|
|
|
step 'I should see "Personal snippet internal" in snippets' do
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(page).to have_content "Personal snippet internal"
|
2014-10-08 09:44:25 -04:00
|
|
|
end
|
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'I should not see "Personal snippet one" in snippets' do
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(page).not_to have_content "Personal snippet one"
|
2013-03-24 18:17:38 -04:00
|
|
|
end
|
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'I should not see "Personal snippet private" in snippets' do
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(page).not_to have_content "Personal snippet private"
|
2013-03-24 18:17:38 -04:00
|
|
|
end
|
|
|
|
|
2014-10-08 09:44:25 -04:00
|
|
|
step 'I should not see "Personal snippet internal" in snippets' do
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(page).not_to have_content "Personal snippet internal"
|
2014-10-08 09:44:25 -04:00
|
|
|
end
|
|
|
|
|
2014-10-07 04:54:00 -04:00
|
|
|
step 'I click "Internal" filter' do
|
2015-10-18 08:17:15 -04:00
|
|
|
page.within('.snippet-scope-menu') do
|
2014-10-07 04:54:00 -04:00
|
|
|
click_link "Internal"
|
2013-03-24 18:17:38 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'I click "Private" filter' do
|
2015-10-18 08:17:15 -04:00
|
|
|
page.within('.snippet-scope-menu') do
|
2013-03-24 18:17:38 -04:00
|
|
|
click_link "Private"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-10-08 09:44:25 -04:00
|
|
|
step 'I click "Public" filter' do
|
2015-10-18 08:17:15 -04:00
|
|
|
page.within('.snippet-scope-menu') do
|
2014-10-08 09:44:25 -04:00
|
|
|
click_link "Public"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-03-24 18:17:38 -04:00
|
|
|
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
|