On Fri, Mar 20, 2009 at 9:45 AM, James Byrne <li...@ruby-forum.com> wrote:

> I ran script/generate cucumber and since then I am having a few
> difficulties.  For instance, take this case:
>
>
> When /see (?:an|the) authori(?:s|z)ation required message/ do
>  Then "I should see \"You are not authori(?:s|z)ed\""
> end
>
> Now gives:
>
>    And they should see an authorization required message
>           # features/app/step_definitions/authorization_steps.rb:1
>      expected the following element's content to include
>           "You are not authori(?:s|z)ed":
> ...
>          You are not authorized to access the requested resource
>
> This matcher worked perfectly well in cucumber up to and including  v
> 0.2.0, until after I ran script/generate cucumber.  The problem seems to
> be the substitution in webrat_steps.rb of:
>
>  response.should contain(text)
> for
>  response.body.should =~ /#{text}/m
>

We switched to using response.should contain(text) a while back. This is
just a wrapper around Rails' assert_contain, the preferred (I think) way to
check for text on a page.

I'm not sure what Cucumber version you're on.

Aslak

>
> I have reverted to the old style matcher which solves my immediate
> problem.  My question is: Was subpattern matching deliberately removed
> from this matcher or is this an error?
>
> P.S. This is Canada and up here both 'ise' (UK) and 'ize' (US) endings
> are commonly used. However, generally those who choose one despise those
> who choose the other.  So as to have peace over a triviality I provide
> for both.
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> rspec-users mailing list
> rspec-users@rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to