Skip to content

Instantly share code, notes, and snippets.

@fltiago
Created October 8, 2012 18:13
Show Gist options
  • Save fltiago/3853998 to your computer and use it in GitHub Desktop.
Save fltiago/3853998 to your computer and use it in GitHub Desktop.
describe Grape::API do
subject { Wally.new }
def app; subject end
...
context "GET wall by resource_id" do
context "when exist a wall" do
before do
subject.helpers do
def permit
permit = double("Permit::Mechanism")
permit.stub(:able_to?).and_return(false)
permit
end
end
get "/walls/#{@wall.resource_id}", {token: @author.token}
end
...
@unorthodoxgeek
Copy link

this can't be the way to do this. This is Ruby for fuck sake, rewriting methods for tests is SO Java.

@unorthodoxgeek
Copy link

this can't be the way to do this. This is Ruby for fuck sake, rewriting methods for tests is SO Java.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment