spec/services/rapidfire/attempt_builder_spec.rb in rapidfire-5.0.0 vs spec/services/rapidfire/attempt_builder_spec.rb in rapidfire-8.0.0
- old
+ new
@@ -3,13 +3,13 @@
def fixture_file_upload(path, mime_type)
Rack::Test::UploadedFile.new(Pathname.new(file_fixture_path).join(path), mime_type, false)
end
describe Rapidfire::AttemptBuilder do
- let(:survey) { FactoryGirl.create(:survey) }
- let(:question1) { FactoryGirl.create(:q_short, survey: survey) }
- let(:question2) { FactoryGirl.create(:q_long, survey: survey,
+ let(:survey) { FactoryBot.create(:survey) }
+ let(:question1) { FactoryBot.create(:q_short, survey: survey) }
+ let(:question2) { FactoryBot.create(:q_long, survey: survey,
validation_rules: { presence: "1" }) }
describe "Creation" do
let(:builder) { described_class.new(survey: survey) }
before { [question1, question2] }
@@ -89,11 +89,11 @@
end
end
if "#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}" >= "5.2"
context "with a single file upload question" do
- let(:question3) { FactoryGirl.create(:q_file, survey: survey) }
+ let(:question3) { FactoryBot.create(:q_file, survey: survey) }
let(:answer_params) do
{
question1.id.to_s => { :answer_text => "short answer" },
question2.id.to_s => { :answer_text => "long answer" },
@@ -109,10 +109,10 @@
expect(answer.file.download).to eq("one\n")
end
end
context "with multiple files upload question" do
- let(:question3) { FactoryGirl.create(:q_multifile, survey: survey) }
+ let(:question3) { FactoryBot.create(:q_multifile, survey: survey) }
let(:answer_params) do
{
question1.id.to_s => { :answer_text => "short answer" },
question2.id.to_s => { :answer_text => "long answer" },