user3688241
user3688241

Reputation: 3145

How to test browser and os specific logic in capybara?

I have some logic that uses HTTP_USER_AGENT to determine whether a user is on chrome and ios. I'm at a loss for how to create a test for this. Is there some way in capybara to force the HTTP_USER_AGENT value?

Upvotes: 1

Views: 44

Answers (1)

Thomas Walpole
Thomas Walpole

Reputation: 49870

In poltergeist you can do

page.driver.set_headers({'User-Agent' => 'whatever User-Agent you want'})

Upvotes: 2

Related Questions