spec/unit/lib/web/element_dsl_spec.rb in howitzer-2.0.0 vs spec/unit/lib/web/element_dsl_spec.rb in howitzer-2.0.1

- old
+ new

@@ -3,15 +3,20 @@ RSpec.describe Howitzer::Web::ElementDsl do let(:klass) do Class.new do include Howitzer::Web::ElementDsl - def capybara_context - Capybara.current_session + def capybara_scopes + @_scopes ||= [Capybara.current_session] end end end let(:klass_object) { klass.new } + + it 'returns correct capybara context' do + allow(Capybara).to receive(:current_session) { 'session' } + expect(klass_object.capybara_context).to eq('session') + end include_examples :element_dsl include_examples :capybara_context_holder end