> I'm trying to make sure that my cucumber selenium suite fails if my Rails
> app returns any 500 response codes. I'm working on what the best way to
> identify this state, but the question I'd like to put to the list is this:
> If I want to check for this error condition in an After or AfterStep, how
> can I force a failure in the scenario?
>
To be honest, I don't remember what happened to AfterStep. I think we
had it at some point, but can't see it in the codebase. Did I remove
it? Or was that back in the pre-Cucumber days? Help me remember
here...
> i.e. something like the following non-functional snippet:
>
> AfterStep do |scenario|
> if foo_error_state_detected?
> scenario.fail("A foo failure has been detected.")
> end
> end
>
> Ideas?
>
I'm not so sure I like the idea of AfterStep - smells like a
workaround for something that belongs elsewhere. Can't your have
selenium-rc (or a helper method you create around it) raise those
exceptions?
Given /bla/ do
# don't remember the API, but you get the idea
@browser.goto_strict('/bla') # raises on 500 errors
end
Aslak
> TIA,
> Luke
> --
> Luke Melia
> [email protected]
> http://www.lukemelia.com/
>
> _______________________________________________
> rspec-users mailing list
> [email protected]
> http://rubyforge.org/mailman/listinfo/rspec-users
>
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users