spec/eeny-meeny/models/experiment_spec.rb in eeny-meeny-2.2.1 vs spec/eeny-meeny/models/experiment_spec.rb in eeny-meeny-2.2.2
- old
+ new
@@ -168,10 +168,16 @@
context 'when EenyMeeny is not configured with experiments' do
it 'returns an empty array' do
expect(described_class.find_all).to eq([])
end
end
+
+ context 'when EenyMeeny is configured with an empty experiments file', empty_experiments: true do
+ it 'returns an empty array' do
+ expect(described_class.find_all).to eq([])
+ end
+ end
end
describe '.find_by_id' do
context 'when EenyMeeny is configured with experiments', experiments: true do
context 'and the given id exists' do
@@ -186,9 +192,15 @@
end
end
end
context 'when EenyMeeny is not configured with experiments' do
+ it 'returns nil' do
+ expect(described_class.find_by_id(:experiment_missing)).to be_nil
+ end
+ end
+
+ context 'when EenyMeeny is configured with an empty experiments file', empty_experiments: true do
it 'returns nil' do
expect(described_class.find_by_id(:experiment_missing)).to be_nil
end
end
end