Skip to content

Instantly share code, notes, and snippets.

@shingara
Created December 15, 2008 22:37
Show Gist options
  • Save shingara/36126 to your computer and use it in GitHub Desktop.
Save shingara/36126 to your computer and use it in GitHub Desktop.
#Controller
before :ensure_authenticated, :exclude => [:index, :show]
def new(project_id)
only_provides :html
@ticket = Ticket.new(:project_id => project_id)
display @ticket, :status => 401
end
# RSPEC
describe "resource(Project.first, :tickets, :new)" do
before(:each) do
@response = request(resource(Project.first, :tickets, :new))
end
it "responds successfully" do
@response.status.should == 401
#TEST more than status ?
# @response.should render(Merb::Controller::Unauthenticate)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment