|
|
|
@ -8,9 +8,9 @@ RSpec.describe Form::Setup::Questions::CreatedById, type: :model do
|
|
|
|
|
let(:page) { instance_double(Form::Page) } |
|
|
|
|
let(:subsection) { instance_double(Form::Subsection) } |
|
|
|
|
let(:form) { instance_double(Form) } |
|
|
|
|
let!(:user_1) { FactoryBot.create(:user, name: "first user") } |
|
|
|
|
let!(:user_2) { FactoryBot.create(:user, name: "second user") } |
|
|
|
|
let!(:user_3) { FactoryBot.create(:user, name: nil, email: "madeupmail@example.com") } |
|
|
|
|
let!(:user_1) { FactoryBot.build(:user, name: "first user") } |
|
|
|
|
let!(:user_2) { FactoryBot.build(:user, name: "second user") } |
|
|
|
|
let!(:user_3) { FactoryBot.build(:user, name: nil, email: "madeupmail@example.com") } |
|
|
|
|
let(:expected_answer_options) do |
|
|
|
|
{ |
|
|
|
|
"" => "Select an option", |
|
|
|
@ -20,6 +20,10 @@ RSpec.describe Form::Setup::Questions::CreatedById, type: :model do
|
|
|
|
|
} |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
before do |
|
|
|
|
allow(User).to receive(:select).and_return [user_1, user_2, user_3] |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "has correct page" do |
|
|
|
|
expect(question.page).to eq(page) |
|
|
|
|
end |
|
|
|
|