pages_spec.rb 879 Bytes
Newer Older
1
2
3
require 'rails_helper'

feature 'Pages' do
PiTrem's avatar
PiTrem committed
4
  let(:john) { create(:person) }
5

PiTrem's avatar
PiTrem committed
6
7
##FIXME  Selenium::WebDriver::Error::WebDriverError:   unable to obtain stable firefox connection in 60 seconds (127.0.0.1:7055)
  before { skip }
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
  background do
    sign_in(john)
  end

  describe 'Change Profile' do
    before do
      visit '/pages/profiles'
    end

    scenario 'sets "Show external name" from false to true, and vice versa', js: true do
      expect(john.reload.profile.show_external_name).to eq false

      page.find(:css, 'input[type="checkbox"]').set(true)
      click_button 'Change my profile'

      expect(john.reload.profile.show_external_name).to eq true

      visit '/pages/profiles'
      page.find(:css, 'input[type="checkbox"]').set(false)
      click_button 'Change my profile'

      expect(john.reload.profile.show_external_name).to eq false
    end
  end
end