diff --git a/spec/controllers/organizations_controller_spec.rb b/spec/controllers/organizations_controller_spec.rb index 8bf15c25b..fc4144bf6 100644 --- a/spec/controllers/organizations_controller_spec.rb +++ b/spec/controllers/organizations_controller_spec.rb @@ -5,16 +5,6 @@ let(:member) { Fabricate(:member, organization: organization) } let(:user) { member.user } - describe 'GET #show' do - it 'displays the organization page' do - get 'show', id: organization.id - - expect(assigns(:organization)).to eq(organization) - expect(response.status).to eq(200) - expect(response.body).to include(organization.name) - end - end - describe 'GET #index' do it 'populates and array of organizations' do get :index @@ -23,6 +13,15 @@ end end + describe 'GET #show' do + it 'displays the organization page' do + get 'show', id: organization.id + + expect(assigns(:organization)).to eq(organization) + expect(response.status).to eq(200) + end + end + describe 'POST #create' do it 'only superdamins are authorized create to new organizations' do login(member.user) diff --git a/spec/views/organizations/show.html.erb_spec.rb b/spec/views/organizations/show.html.erb_spec.rb index 785cb9ca2..e2ccb6310 100644 --- a/spec/views/organizations/show.html.erb_spec.rb +++ b/spec/views/organizations/show.html.erb_spec.rb @@ -57,5 +57,9 @@ it 'diplays the movements section' do expect(rendered).to match t('shared.movements.movements') end + + it 'displays the organization page' do + expect(rendered).to match(organization.name) + end end end