summaryrefslogtreecommitdiff
path: root/features/steps/project/labels.rb
blob: 3f800a105941cf2ea06c91abbcd4a902a05c10d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
class Spinach::Features::Labels < Spinach::FeatureSteps
  include SharedAuthentication
  include SharedIssuable
  include SharedProject
  include SharedNote
  include SharedPaths
  include SharedMarkdown

  step 'And I visit project "Shop" labels page' do
    visit namespace_project_labels_path(project.namespace, project)
  end

  step 'I should see that I am subscribed' do
    expect(subscribe_button).to have_content 'Unsubscribe'
  end

  step 'I should see that I am unsubscribed' do
    expect(subscribe_button).to have_content 'Subscribe'
  end

  step 'I click button "Unsubscribe"' do
    subscribe_button.click
  end

  step 'I click button "Subscribe"' do
    subscribe_button.click
  end

  private

  def subscribe_button
    first('.subscribe-button span')
  end
end