A. Neumann
A. Neumann

Reputation: 538

How to get feature spec login helpers in Refinery CMS up and running?

I want to use login_refinery_user-helper methods for my refinery feature specs. I added the following to spec/support/devise.rb according to this post: https://stackoverflow.com/a/11926783/5941617

RSpec.configure do |config|
  config.include Devise::TestHelpers, :type => :controller
  config.extend  ::Refinery::Testing::ControllerMacros::Authentication, :type => :controller
  config.extend  ::Refinery::Testing::RequestMacros::Authentication, :type => :request
end

Unfortunately my specs cannot find the requested methods. I cannot find the method either, even Refinery::Testing::RequestMacros is not present, although it should be according to https://github.com/resolve/refinerycms/blob/master/testing/lib/refinery/testing/request_macros/authentication.rb

Does someone know what needs to be done in order to enable the proper helpers?

gem list | ack refinery

refinerycms (4.0.2)

refinerycms-authentication-devise (2.0.0)

refinerycms-core (4.0.2)

refinerycms-dragonfly (1.0.0)

refinerycms-testing (4.0.2)

...

best, Andi

Upvotes: 0

Views: 40

Answers (1)

Thomas Walpole
Thomas Walpole

Reputation: 49930

You need to include the helpers into the correct type of tests. Since you mentioned feature tests you probably need

RSpec.configure do |config|
  config.include Devise::TestHelpers, :type => :feature
  ...
end

Upvotes: 0

Related Questions