Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Having cream in Gemfile disables Warden::Test::Helpers #25

Open
stanislaw opened this issue May 16, 2011 · 0 comments
Open

Having cream in Gemfile disables Warden::Test::Helpers #25

stanislaw opened this issue May 16, 2011 · 0 comments

Comments

@stanislaw
Copy link

It is again about RSpec requests tests.

I rely on
https://github.com/hassox/warden/wiki/testing and
https://gist.github.com/973983

Having cream in Gemfile and
in config/initializers/cream_and_rest_links.rb:
module Cream
def self.available_roles
[:user, :student, :curator, :instructor, :guest, :admin]
end
end

require 'cancan-rest-links/rails/configure'

require 'cream'
require 'cream/configure/rails'

...results in controllers aren't aware of current_user

sample spec
it "works! (now write some real specs)" do
  visit(destroy_user_session_path)
  login_as(@curator) # this doesn't set current_user as @curator!!!
  get ptp_techniques_path # here, in the controller, current_user appears defined like guest !!!
  ...
end

Without Cream in Gemfile and in initializer all request specs pass_OK.

Looks like Cream overrides some Warden things needed for Warden test helpers.

Stanislaw

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant