[rspec-users] cucumber and openid

aslak hellesoy aslak.hellesoy at gmail.com
Mon Sep 1 16:31:37 EDT 2008


On Mon, Sep 1, 2008 at 9:25 PM, Priit Tamboom <priit at mx.ee> wrote:
> Hi!
>
> I'm new to Cucumber/Story Runner, but not so new to Rspec in general.
> I googled a lot before
> posting :-)
>
> I would like to mock openid consumer however I'm running out of ideas
> how to access session.
> I know I should avoid mocking in integration testing, but in this case
> it makes sense.
> Perhaps I can somehow mock session[:current_user_id] like it is
> possible in rspec.
>
> Given /I am logged in as admin/ do
>   user = User.find(:first)
>   session.stub!(:current_user_id).and_return(user.id)
> end
>
> Any hints how it can solve my mocking in Cucumber would be welcome!
>

Mocking in Cucumber works just like in RSpec. Are you getting any errors?

Aslak

> Cheers,
> Priit
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


More information about the rspec-users mailing list