Initial commit
This commit is contained in:
16
spec/support/window_size_helper.rb
Normal file
16
spec/support/window_size_helper.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
module WindowSizeHelper
|
||||
def resize_window_to(width, height)
|
||||
old_size = Capybara.current_session.current_window.size
|
||||
Capybara.current_session.current_window.resize_to(width, height)
|
||||
yield
|
||||
Capybara.current_session.current_window.resize_to(*old_size)
|
||||
end
|
||||
|
||||
def set_window_size_permanently_to(width, height)
|
||||
Capybara.current_session.current_window.resize_to(width, height)
|
||||
end
|
||||
end
|
||||
|
||||
RSpec.configure do |config|
|
||||
config.include WindowSizeHelper, type: :feature
|
||||
end
|
||||
Reference in New Issue
Block a user