You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
762 B
30 lines
762 B
2 years ago
|
require "rails_helper"
|
||
|
|
||
|
RSpec.describe "schemes/show.html.erb" do
|
||
|
context "when data provider" do
|
||
|
let(:organisation) { create(:organisation, holds_own_stock: true) }
|
||
|
let(:user) { build(:user, organisation:) }
|
||
|
let(:scheme) { create(:scheme, owning_organisation: user.organisation) }
|
||
|
|
||
|
it "does not render button to deactivate schemes" do
|
||
|
assign(:scheme, scheme)
|
||
|
|
||
|
allow(view).to receive(:current_user).and_return(user)
|
||
|
|
||
|
render
|
||
|
|
||
|
expect(rendered).not_to have_content("Deactivate this scheme")
|
||
|
end
|
||
|
|
||
|
it "does not see change answer links" do
|
||
|
assign(:scheme, scheme)
|
||
|
|
||
|
allow(view).to receive(:current_user).and_return(user)
|
||
|
|
||
|
render
|
||
|
|
||
|
expect(rendered).not_to have_content("Change")
|
||
|
end
|
||
|
end
|
||
|
end
|