Displaying 3 results from an estimated 3 matches for "tickets_path".
2007 Aug 21
2
using restful_authentication current_user inside controller specs
...equired
around_filter :set_timezone
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,...
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
2008 Apr 22
8
How to GET/POST in Rails ?
Is there a definitive guide on how to create a controller that
understands and responds to GET/POST methods ? This does not
necessarily mean I''m trying RESTful Web services.
Google returned lot of material but most of them is pre-Rails 2.0 or
not well explained. Did I miss any obvious document ?
-Arun
--~--~---------~--~----~------------~-------~--~----~
You received this message