From a9f101809bc1ddefa3cfc3aa4ea8d0d0baf783fd Mon Sep 17 00:00:00 2001 From: marisa Date: Fri, 28 Feb 2020 13:34:33 +0100 Subject: [PATCH 1/2] Move spec from controller to view --- spec/controllers/organizations_controller_spec.rb | 10 ---------- spec/views/organizations/show.html.erb_spec.rb | 4 ++++ 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/spec/controllers/organizations_controller_spec.rb b/spec/controllers/organizations_controller_spec.rb index 8bf15c25b..cd0ba5a55 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 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 From 1fa4e033716bfd86778bd5fd2ce9d612b6cc8f74 Mon Sep 17 00:00:00 2001 From: marisa Date: Tue, 3 Mar 2020 10:55:30 +0100 Subject: [PATCH 2/2] Return describe 'GET #show' where it was --- spec/controllers/organizations_controller_spec.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spec/controllers/organizations_controller_spec.rb b/spec/controllers/organizations_controller_spec.rb index cd0ba5a55..fc4144bf6 100644 --- a/spec/controllers/organizations_controller_spec.rb +++ b/spec/controllers/organizations_controller_spec.rb @@ -13,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)