The following error I am getting when Testing the app
Then a invitation message should be sent to “xyz@example.com” # features/step_definitions/office_staff_steps.rb:5
expected the following element’s content to include “Invitation sent successfully”:
window.location.href = “/office_staffs”; (Spec::Expectations::ExpectationNotMetError)
Then /^a invitation message should be sent to “([^”]*)"$/ do |arg1|
And “I should see “Invitation sent successfully””
end
Your problem is that you are able to see the sucess message when testing from browser but not through cucumber?
I think you did not code completely the steps definition.
Then /^a invitation message should be sent to “([^”]*)"$/ do |arg1|
And “I should see “Invitation sent successfully””
end
In this you need some form action (mostly through webrat) like ‘When I press Send’
Hello Satyajit/clemens,
Thanks for your reply.
On the controller side once the request is completed
I am doing
render :update do |page|
flash[:notice] = “Invitation sent successfully to #{@object.email}”
page.replace_html “something”, :partial => “some_partial”
end So this works fine when I am testing it on a browser. but it get failed when I do the same thing with cucumber.
something.feature -->
Scenario: something
Given blah blah blah
And I fill in “name” with “abhis”
And I fill in “email” with “abhis@example.com”
And I press “Add”
Then a invitation message should be sent to “abhis@example.com” something_steps.rbThen /^a invitation message should be sent to “([^”]*)"$/ do |email|
And “I should see “Invitation sent successfully to #{email}””
end
Thanks for any help.