add home_spec integration test
This commit is contained in:
parent
fbba08a17a
commit
3be6841f6f
1 changed files with 21 additions and 0 deletions
21
spec/integration/home_spec.rb
Normal file
21
spec/integration/home_spec.rb
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
require_relative '../spec_helper'
|
||||||
|
|
||||||
|
feature HomeController do
|
||||||
|
let(:user) { create :user }
|
||||||
|
before { login user }
|
||||||
|
describe 'my profile' do
|
||||||
|
before { visit my_profile_path }
|
||||||
|
|
||||||
|
it 'is accessible' do
|
||||||
|
expect(page).to have_selector 'input[id=user_first_name]'
|
||||||
|
expect(find_field('user_first_name').value).to eq(user.first_name)
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'updates first name' do
|
||||||
|
fill_in 'user_first_name', with: "foo"
|
||||||
|
click_button('Save')
|
||||||
|
expect(User.find(user.id).first_name).to eq "foo"
|
||||||
|
expect(page).to have_selector '.alert-success'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue