Cucumber + Ajax

Hello Friends.

I have a scenario where I am using “link_to_remote” For a ajax request.

Cucmber Script
Then I click on “Active”

Steps
Then /^I click on “([^”]*)"$/ do |click|
visit("/controller/some_action/#{@office.id}")
end

controller

def some_action
if post.xhr?
something…
end
end

But When I run the cucumber script I am post.xhr? “FALSE” But the same I am getting true from browser

Can you please help me out Where I am getting worng?

thanks
abhis

the cucumber/webrat visit is not a xhr (ajax) call. You probably need
to go with watir or selenium...

I assume you are using Cucumber with webrat. WebRat does not support Ajax, for that, you would need to use Selenium.

Check out the Selenium page on the cucumber github wiki for more info. If you need additional help after that, contact me directly and I may be able to help you set it up.

Cheers,

Marcelo.