#33641: add spec for profile page
This commit is contained in:
parent
4c2df7d43c
commit
0814129561
1 changed files with 18 additions and 0 deletions
18
spec/views/profiles/show.html.haml_spec.rb
Normal file
18
spec/views/profiles/show.html.haml_spec.rb
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe 'profiles/show' do
|
||||||
|
let(:user) { create(:user) }
|
||||||
|
|
||||||
|
before do
|
||||||
|
assign(:user, user)
|
||||||
|
allow(controller).to receive(:current_user).and_return(user)
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'when the profile page is opened' do
|
||||||
|
it 'displays the correct elements' do
|
||||||
|
render
|
||||||
|
expect(rendered).to have_field("user_name", user.name)
|
||||||
|
expect(rendered).to have_field("user_id", user.id)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue