summaryrefslogtreecommitdiff
path: root/features/steps/profile/group.rb
blob: 0a10e04e219b0da374e2e69e250e9469d1028518 (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
35
36
37
38
39
40
41
42
43
44
class Spinach::Features::ProfileGroup < Spinach::FeatureSteps
  include SharedAuthentication
  include SharedGroup
  include SharedPaths
  include SharedUser

  # Leave

  step 'I click on the "Leave" button for group "Owned"' do
    find(:css, 'li', text: "Owner").find(:css, 'i.fa.fa-sign-out').click
    # poltergeist always confirms popups.
  end

  step 'I click on the "Leave" button for group "Guest"' do
    find(:css, 'li', text: "Guest").find(:css, 'i.fa.fa-sign-out').click
    # poltergeist always confirms popups.
  end

  step 'I should not see the "Leave" button for group "Owned"' do
    find(:css, 'li', text: "Owner").should_not have_selector(:css, 'i.fa.fa-sign-out')
    # poltergeist always confirms popups.
  end

  step 'I should not see the "Leave" button for groupr "Guest"' do
    find(:css, 'li', text: "Guest").should_not have_selector(:css,  'i.fa.fa-sign-out')
    # poltergeist always confirms popups.
  end

  step 'I should see group "Owned" in group list' do
    page.should have_content("Owned")
  end

  step 'I should not see group "Owned" in group list' do
    page.should_not have_content("Owned")
  end

  step 'I should see group "Guest" in group list' do
    page.should have_content("Guest")
  end

  step 'I should not see group "Guest" in group list' do
    page.should_not have_content("Guest")
  end
end