|
|
@ -51,8 +51,20 @@ RSpec.describe Form::Lettings::Questions::CreatedById, type: :model do |
|
|
|
expect(question.derived?).to be true |
|
|
|
expect(question.derived?).to be true |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
it "is not shown in check answers" do |
|
|
|
context "when the current user is support" do |
|
|
|
expect(question.hidden_in_check_answers?(nil, user_1)).to be true |
|
|
|
let(:support_user) { FactoryBot.build(:user, :support) } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "is shown in check answers" do |
|
|
|
|
|
|
|
expect(question.hidden_in_check_answers?(nil, support_user)).to be false |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context "when the current user is not support" do |
|
|
|
|
|
|
|
let(:user) { FactoryBot.build(:user) } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "is not shown in check answers" do |
|
|
|
|
|
|
|
expect(question.hidden_in_check_answers?(nil, user)).to be true |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when the owning organisation is already set" do |
|
|
|
context "when the owning organisation is already set" do |
|
|
|