Advertisement
Guest User

Untitled

a guest
Dec 19th, 2014
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. expect(ability).to be_able_to(:destroy, Project.new(:user => user))
  2.  
  3. NoMethodError: undefined method `expect' for main:Object
  4.  
  5. require 'spec_helper'
  6. require "cancan/matchers"
  7.  
  8. describe Ability do
  9. it "user has ability" do
  10. user = FactoryGirl.create(:user)
  11. ability = Ability.new(user)
  12. expect(ability).to be_able_to(:destroy, Project.new(:user => user))
  13. end
  14. end
  15.  
  16. 2.1.5 :004 > expect(ability).to be_able_to(:destroy, Project.new(:user => user))
  17. NoMethodError: undefined method `expect' for main:Object
  18. from (irb):4
  19. from /home/weare138/.rvm/gems/ruby-2.1.5/gems/railties-4.1.4/lib/rails/commands/console.rb:90:in `start'
  20. from /home/weare138/.rvm/gems/ruby-2.1.5/gems/railties-4.1.4/lib/rails/commands/console.rb:9:in `start'
  21. from /home/weare138/.rvm/gems/ruby-2.1.5/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:69:in `console'
  22. from /home/weare138/.rvm/gems/ruby-2.1.5/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
  23. from /home/weare138/.rvm/gems/ruby-2.1.5/gems/railties-4.1.4/lib/rails/commands.rb:17:in `<top (required)>'
  24. from bin/rails:4:in `require'
  25. from bin/rails:4:in `<main>'
  26. 2.1.5 :005 >
  27.  
  28. bundle exec rspec path/to/ability_spec.rb
  29.  
  30. bundle exec rspec .
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement