Displaying 2 results from an estimated 2 matches for "new_ticket_path".
2007 Aug 21
2
using restful_authentication current_user inside controller specs
...around_filter :catch_errors
Currently I have them commented out while rspec''in but I''ll need to add them
in my specs.
def create
@ticket = Ticket.new(params[:ticket])
@ticket.user = current_user
if @ticket.save
redirect_to tickets_path
else
render new_ticket_path(params[:user_id])
end
end
describe TicketsController, "handling POST /tickets" do
before do
@ticket = mock_model(Ticket, :save => true)
@current_user = mock_model(User)
@params = {}
end
def do_post
post :create, :ticket => @params
end
it &qu...
2007 Aug 17
11
[rspec] looking for a simple refresher
I''ve been off the rspec for a few months and I''m trying to get back on it.
1)
Spec::Mocks::MockExpectationError in ''TicketsController handling POST
/tickets should create a new ticket''
Mock ''Ticket_1001'' expected :new with ({}) once, but received it 0 times
./spec/controllers/tickets_controller_spec.rb:16:
script/spec:4:
class