spec/environment_spec.rb in seed_dump-3.2.4 vs spec/environment_spec.rb in seed_dump-3.3.0
- old
+ new
@@ -7,22 +7,28 @@
end
before(:each) do
Rails.application.eager_load!
- FactoryGirl.create(:sample)
+ FactoryBot.create(:sample)
end
describe 'APPEND' do
it "should specify append as true if the APPEND env var is 'true'" do
SeedDump.should_receive(:dump).with(anything, include(append: true))
SeedDump.dump_using_environment('APPEND' => 'true')
end
+ it "should specify append as true if the APPEND env var is 'TRUE'" do
+ SeedDump.should_receive(:dump).with(anything, include(append: true))
+
+ SeedDump.dump_using_environment('APPEND' => 'TRUE')
+ end
+
it "should specify append as false the first time if the APPEND env var is not 'true' (and true after that)" do
- FactoryGirl.create(:another_sample)
+ FactoryBot.create(:another_sample)
SeedDump.should_receive(:dump).with(anything, include(append: false)).ordered
SeedDump.should_receive(:dump).with(anything, include(append: true)).ordered
SeedDump.dump_using_environment('APPEND' => 'false')
@@ -81,11 +87,11 @@
model_env = 'MODEL' + model_suffix
describe model_env do
context "if #{model_env} is not specified" do
it "should dump all non-empty models" do
- FactoryGirl.create(:another_sample)
+ FactoryBot.create(:another_sample)
[Sample, AnotherSample].each do |model|
SeedDump.should_receive(:dump).with(model, anything)
end
@@ -93,11 +99,11 @@
end
end
context "if #{model_env} is specified" do
it "should dump only the specified model" do
- FactoryGirl.create(:another_sample)
+ FactoryBot.create(:another_sample)
SeedDump.should_receive(:dump).with(Sample, anything)
SeedDump.dump_using_environment(model_env => 'Sample')
end
@@ -111,10 +117,10 @@
end
end
describe "MODELS_EXCLUDE" do
it "should dump all non-empty models except the specified models" do
- FactoryGirl.create(:another_sample)
+ FactoryBot.create(:another_sample)
SeedDump.should_receive(:dump).with(Sample, anything)
SeedDump.dump_using_environment('MODELS_EXCLUDE' => 'AnotherSample')
end