Skip to content

Commit 694efa0

Browse files
committed
Fix mobile specs
These were (a) trying to use a non-existent session, and (b) trying to set both `mobile: true` and a resolution, which is now disallowed.
1 parent 5685a64 commit 694efa0

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lib/capybara/cuprite/page.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,11 @@ def prepare_page
144144
super
145145

146146
width, height = @options.window_size
147-
resize(width: width, height: height, mobile: @options.mobile)
147+
if @options.mobile
148+
resize(width: 0, height: 0, mobile: @options.mobile)
149+
else
150+
resize(width: width, height: height, mobile: @options.mobile)
151+
end
148152

149153
if @options.url_blacklist.any?
150154
network.blacklist = @options.url_blacklist

spec/spec_helper.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040

4141
module TestSessions
4242
Cuprite = Capybara::Session.new(:cuprite, TestApp)
43+
CupriteMobile = Capybara::Session.new(:cuprite_mobile, TestApp)
4344
end
4445

4546
RSpec.configure do |config|

0 commit comments

Comments
 (0)