Hello Friends, The following error I am getting when Testing the app Then a invitation message should be sent to "xyz-hcDgGtZH8xNBDgjK7y7TUQ@public.gmane.org" # 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 And the same is working fine on the browser. Let me know if someone has the same problem. Thanks Abhis -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Any help? Thanks Abhishek On Mon, Nov 30, 2009 at 6:25 PM, Abhishek shukla <betterabhi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote:> Hello Friends, > > The following error I am getting when Testing the app > > Then a invitation message should be sent to "xyz-hcDgGtZH8xNBDgjK7y7TUQ@public.gmane.org" # > 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 > > And the same is working fine on the browser. > > Let me know if someone has the same problem. > > Thanks > Abhis > > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Abishek, 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'' Send in more details if you need further help. Satyajit On Mon, Nov 30, 2009 at 8:01 AM, Abhishek shukla <betterabhi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote:> Any help? > > Thanks > Abhishek > > > On Mon, Nov 30, 2009 at 6:25 PM, Abhishek shukla <betterabhi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote: > >> Hello Friends, >> >> The following error I am getting when Testing the app >> >> Then a invitation message should be sent to "xyz-hcDgGtZH8xNBDgjK7y7TUQ@public.gmane.org" # >> 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 >> >> And the same is working fine on the browser. >> >> Let me know if someone has the same problem. >> >> Thanks >> Abhis >> >> >> > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. >-- Satyajit -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Are you using Webrat::Selenium, watir or selenium? Plain webrat won''t suffice as you can''t emulate javascript (including the ajax callback)... On 30 Nov., 13:55, Abhishek shukla <bettera...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello Friends, > > The following error I am getting when Testing the app > > Then a invitation message should be sent to "x...-hcDgGtZH8xNBDgjK7y7TUQ@public.gmane.org" # > 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 > > And the same is working fine on the browser. > > Let me know if someone has the same problem. > > Thanks > Abhis-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
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-hcDgGtZH8xNBDgjK7y7TUQ@public.gmane.org" And I press "Add" Then a invitation message should be sent to "abhis-hcDgGtZH8xNBDgjK7y7TUQ@public.gmane.org" *something_steps.rb *Then /^a invitation message should be sent to "([^\"]*)"$/ do |email| And "I should see \"Invitation sent successfully to #{email}\"" end* * Thanks for any help. Thanks Abhis On Tue, Dec 1, 2009 at 12:40 PM, Clemens <clemens.wyss-7fY5B7ekypAfv37vnLkPlQ@public.gmane.org> wrote:> Are you using Webrat::Selenium, watir or selenium? > Plain webrat won''t suffice as you can''t emulate javascript (including > the ajax callback)... > > On 30 Nov., 13:55, Abhishek shukla <bettera...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Hello Friends, > > > > The following error I am getting when Testing the app > > > > Then a invitation message should be sent to "x...-hcDgGtZH8xNBDgjK7y7TUQ@public.gmane.org" > # > > 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 > > > > And the same is working fine on the browser. > > > > Let me know if someone has the same problem. > > > > Thanks > > Abhis > > -- > > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Ok I came to know where I was getting wrong. Then "a" invitation message should be sent to "abhis-hcDgGtZH8xNBDgjK7y7TUQ@public.gmane.org" The "a" should be in capital. "A" Then "A" invitation message should be sent to "abhis-hcDgGtZH8xNBDgjK7y7TUQ@public.gmane.org" :) Thanks Abhishek On 12/1/09, Abhishek shukla <betterabhi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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-hcDgGtZH8xNBDgjK7y7TUQ@public.gmane.org" > And I press "Add" > Then a invitation message should be sent to "abhis-hcDgGtZH8xNBDgjK7y7TUQ@public.gmane.org" > > *something_steps.rb > > *Then /^a invitation message should be sent to "([^\"]*)"$/ do |email| > And "I should see \"Invitation sent successfully to #{email}\"" > end* > * > Thanks for any help. > > Thanks > Abhis > > On Tue, Dec 1, 2009 at 12:40 PM, Clemens <clemens.wyss-7fY5B7ekypAfv37vnLkPlQ@public.gmane.org> wrote: > >> Are you using Webrat::Selenium, watir or selenium? >> Plain webrat won''t suffice as you can''t emulate javascript (including >> the ajax callback)... >> >> On 30 Nov., 13:55, Abhishek shukla <bettera...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> > Hello Friends, >> > >> > The following error I am getting when Testing the app >> > >> > Then a invitation message should be sent to "x...-hcDgGtZH8xNBDgjK7y7TUQ@public.gmane.org" >> # >> > 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 >> > >> > And the same is working fine on the browser. >> > >> > Let me know if someone has the same problem. >> > >> > Thanks >> > Abhis >> >> -- >> >> You received this message because you are subscribed to the Google Groups >> "Ruby on Rails: Talk" group. >> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To unsubscribe from this group, send email to >> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> >> . >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-talk?hl=en. >> >> >> >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.