spec/cucumber/rails/database_spec.rb in cucumber-rails-1.8.0 vs spec/cucumber/rails/database_spec.rb in cucumber-rails-2.0.0
- old
+ new
@@ -9,23 +9,23 @@
let(:strategy_type) { Cucumber::Rails::Database::TruncationStrategy }
it 'forwards events to the selected strategy' do
described_class.javascript_strategy = :truncation
- expect(strategy).to receive(:before_non_js).ordered
+ expect(strategy).to receive(:before_non_js)
described_class.before_non_js
- expect(strategy).to receive(:before_js).ordered
+ expect(strategy).to receive(:before_js)
described_class.before_js
end
it 'raises an error if you use a non-understood strategy' do
expect { described_class.javascript_strategy = :invalid }
.to raise_error(Cucumber::Rails::Database::InvalidStrategy)
end
- describe 'using a custom strategy' do
+ context 'using a custom strategy' do
let(:strategy_type) { ValidStrategy }
class ValidStrategy
def before_js
# Anything
@@ -36,26 +36,26 @@
end
end
class InvalidStrategy; end
- it 'raises an error if the strategy doens\'t support the protocol' do
+ it 'raises an error if the strategy does not have a valid interface' do
expect { described_class.javascript_strategy = InvalidStrategy }
.to raise_error(ArgumentError)
end
- it 'accepts a custom strategy with a valid interface' do
+ it 'accepts the strategy if it has a valid interface' do
expect { described_class.javascript_strategy = ValidStrategy }
.not_to raise_error
end
- it 'forwards events to a custom strategy' do
+ it 'forwards events to the strategy' do
described_class.javascript_strategy = ValidStrategy
- expect(strategy).to receive(:before_non_js).ordered
+ expect(strategy).to receive(:before_non_js)
described_class.before_non_js
- expect(strategy).to receive(:before_js).ordered
+ expect(strategy).to receive(:before_js)
described_class.before_js
end
end
end