Cancan Rspec load_and_authorize_resource

89 views
Skip to first unread message

Sasha Babich

unread,
Nov 22, 2013, 7:10:13 AM11/22/13
to rubyonra...@googlegroups.com
Hello!
While running bundle exec rake, I receive following error (see in
attached file)
However, my tests are steel passing with command rspec spec/controllers/
Some info:
ads_controller.rb:

class AdsController < ApplicationController
load_and_authorize_resource except: :create
end

ads_controller_spec.rb:

require 'spec_helper'
describe AdsController do
render_views
describe 'Guest role' do

it "should not display link to new ad" do
visit ads_path
page.should_not have_content('New')
end
end
end

Gems:
rails (4.0.0),rake (10.1.0),cancan (1.6.10),
* rspec-core (2.14.5)
* rspec-expectations (2.14.3)
* rspec-mocks (2.14.3)
* rspec-rails (2.14.0)

Can`t find any answer in google or github... Will be thankfully for any
help.

Attachments:
http://www.ruby-forum.com/attachment/8954/bundle_exec_rake.txt


--
Posted via http://www.ruby-forum.com/.

koulikoff

unread,
Nov 22, 2013, 3:49:34 PM11/22/13
to rubyonra...@googlegroups.com
hello, try this branch: https://github.com/dima4p/cancan

Sasha Babich

unread,
Nov 22, 2013, 6:00:27 PM11/22/13
to rubyonra...@googlegroups.com
I have tried, but get the same issue. I also tried to set up simple new
app, using scaffold and rspec with cancan - and got into same trouble.
It seems that i must set up somehow my rspec, but i really don`t know
what to do(
Reply all
Reply to author
Forward
0 new messages