Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Macros for Rack #10

Open
hosh opened this issue Apr 23, 2010 · 0 comments
Open

Macros for Rack #10

hosh opened this issue Apr 23, 2010 · 0 comments
Labels

Comments

@hosh
Copy link
Contributor

hosh commented Apr 23, 2010

So some sample Rack macros:

it { should comply_with_rack_api}
it { should redirect_to "/" }
it { should respond_with :404, /We cannot find the page/ }

If the subject_attributes pattern gets implemented cleanly, maybe:

describe :post => "/users/memberships", :json => { :user_id => "foobear" } do
   it { should respond_with valid_rack_response } 
   it { should respond_with :200, :ok }
end

Thought it might end up with something like:

describe RackEndpoint do
  when_receiving :post => "/users/memberships", :json => { :user_id => "foobear" } do
    it { should respond_with valid_rack_response } 
    it { should respond_with :200, :ok }
  end
end

(to avoid having to wrap around describe)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant