mirror of
https://github.com/DatabaseCleaner/database_cleaner
synced 2023-03-27 23:22:03 -04:00
Change expectation for the #strategy method in the Cleaners class
This commit is contained in:
parent
e8d2c031ea
commit
c60ce4d2c9
1 changed files with 9 additions and 8 deletions
|
@ -57,10 +57,6 @@ RSpec.describe DatabaseCleaner::Cleaners do
|
||||||
context "single orm single db" do
|
context "single orm single db" do
|
||||||
let!(:cleaner) { cleaners[:active_record] }
|
let!(:cleaner) { cleaners[:active_record] }
|
||||||
|
|
||||||
it "should proxy strategy" do
|
|
||||||
expect(cleaners.strategy).to eq(cleaner.strategy)
|
|
||||||
end
|
|
||||||
|
|
||||||
it "should proxy strategy=" do
|
it "should proxy strategy=" do
|
||||||
stratagem = double("stratagem")
|
stratagem = double("stratagem")
|
||||||
expect(cleaner).to receive(:strategy=).with(stratagem)
|
expect(cleaner).to receive(:strategy=).with(stratagem)
|
||||||
|
@ -171,11 +167,16 @@ RSpec.describe DatabaseCleaner::Cleaners do
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
let(:result) do
|
||||||
|
{
|
||||||
|
:active_record_1 => :truncation,
|
||||||
|
:active_record_2 => :truncation,
|
||||||
|
:data_mapper_1 => :truncation
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
it "should proxy #strategy to all cleaners and return a single result" do
|
it "should proxy #strategy to all cleaners and return a single result" do
|
||||||
expect(cleaners.strategy)
|
expect(cleaners.strategy).to eq(result)
|
||||||
.to eq(active_record_1.strategy)
|
|
||||||
.and eq(active_record_2.strategy)
|
|
||||||
.and eq(data_mapper_1.strategy)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue