Skip to content

Instantly share code, notes, and snippets.

@kalabiyau
Created November 20, 2013 20:57
Show Gist options
  • Save kalabiyau/7570870 to your computer and use it in GitHub Desktop.
Save kalabiyau/7570870 to your computer and use it in GitHub Desktop.
require 'cancan/matchers'
require 'spec_helper'
describe Ability do
describe Invoice do
before(:each) do
Invoice.any_instance.stub(:debit_fee_percent => 10)
Invoice.any_instance.stub(:credit_fee_percent => 10)
end
it 'walker can create new invoice' do
current_user = FactoryGirl.create :walker_with_invoice
ability = Ability.new(current_user)
ability.should be_able_to(:create, Invoice.new)
end
...
...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment