Files
old-holivud2/spec/support/window_size_helper.rb
2020-05-31 22:38:19 +02:00

17 lines
487 B
Ruby

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