Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- expect(ability).to be_able_to(:destroy, Project.new(:user => user))
- NoMethodError: undefined method `expect' for main:Object
- require 'spec_helper'
- require "cancan/matchers"
- describe Ability do
- it "user has ability" do
- user = FactoryGirl.create(:user)
- ability = Ability.new(user)
- expect(ability).to be_able_to(:destroy, Project.new(:user => user))
- end
- end
- 2.1.5 :004 > expect(ability).to be_able_to(:destroy, Project.new(:user => user))
- NoMethodError: undefined method `expect' for main:Object
- from (irb):4
- from /home/weare138/.rvm/gems/ruby-2.1.5/gems/railties-4.1.4/lib/rails/commands/console.rb:90:in `start'
- from /home/weare138/.rvm/gems/ruby-2.1.5/gems/railties-4.1.4/lib/rails/commands/console.rb:9:in `start'
- from /home/weare138/.rvm/gems/ruby-2.1.5/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:69:in `console'
- from /home/weare138/.rvm/gems/ruby-2.1.5/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
- from /home/weare138/.rvm/gems/ruby-2.1.5/gems/railties-4.1.4/lib/rails/commands.rb:17:in `<top (required)>'
- from bin/rails:4:in `require'
- from bin/rails:4:in `<main>'
- 2.1.5 :005 >
- bundle exec rspec path/to/ability_spec.rb
- bundle exec rspec .
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement