Browse Source

test: add test that including owning org does nothing when user is coordinator

pull/1027/head
Sam Seed 4 years ago
parent
commit
c5fa5a84dc
  1. 14
      spec/requests/schemes_controller_spec.rb

14
spec/requests/schemes_controller_spec.rb

@ -489,6 +489,20 @@ RSpec.describe SchemesController, type: :request do
expect(page).to have_content(I18n.t("activerecord.errors.models.scheme.attributes.service_name.invalid"))
end
end
context "when the organisation id param is included" do
let(:organisation) { FactoryBot.create(:organisation) }
let(:params) do
{ scheme: {
owning_organisation_id: organisation.id,
} }
end
it "sets the owning organisation correctly" do
post "/schemes", params: params
expect(Scheme.last.owning_organisation_id).to eq(user.organisation_id)
end
end
end
context "when signed in as a support user" do

Loading…
Cancel
Save