BigW Consortium Gitlab

user.rb 1.44 KB
Newer Older
1
class Spinach::Features::SnippetsUser < Spinach::FeatureSteps
2 3
  include SharedAuthentication
  include SharedPaths
Andrew8xx8 committed
4
  include SharedSnippet
5

6
  step 'I visit my snippets page' do
7
    visit dashboard_snippets_path
8 9
  end

10
  step 'I should see "Personal snippet one" in snippets' do
11
    expect(page).to have_content "Personal snippet one"
12 13
  end

14
  step 'I should see "Personal snippet private" in snippets' do
15
    expect(page).to have_content "Personal snippet private"
16 17
  end

18
  step 'I should see "Personal snippet internal" in snippets' do
19
    expect(page).to have_content "Personal snippet internal"
20 21
  end

22
  step 'I should not see "Personal snippet one" in snippets' do
23
    expect(page).not_to have_content "Personal snippet one"
24 25
  end

26
  step 'I should not see "Personal snippet private" in snippets' do
27
    expect(page).not_to have_content "Personal snippet private"
28 29
  end

30
  step 'I should not see "Personal snippet internal" in snippets' do
31
    expect(page).not_to have_content "Personal snippet internal"
32 33
  end

34
  step 'I click "Internal" filter' do
35
    page.within('.snippet-scope-menu') do
36
      click_link "Internal"
37 38 39
    end
  end

40
  step 'I click "Private" filter' do
41
    page.within('.snippet-scope-menu') do
42 43 44 45
      click_link "Private"
    end
  end

46
  step 'I click "Public" filter' do
47
    page.within('.snippet-scope-menu') do
48 49 50 51
      click_link "Public"
    end
  end

52
  def snippet
skv committed
53
    @snippet ||= PersonalSnippet.find_by!(title: "Personal snippet one")
54 55
  end
end