I have the following controller test that passes:

describe 'resource(@invitation)', 'when an invitation exists' do
  before do
    @invitation = Invitation.generate
    @uri = resource(@invitation)
  end

  describe 'GET' do
    before do
      @response = request(@uri)
    end

    it_should_behave_like 'It is successful'
    it_should_behave_like 'It displays the show invitation page'
  end
end

I am attempting to replace request(@uri) with get(@uri) above so that  
I can add a block that sets an expectation on the session. In any  
event, if I simple replace "request" with "get" above without adding  
the block, it suddenly fails with the following message:

should respond successfully
interning empty string
/Library/Ruby/Gems/1.8/gems/merb-core-1.0.9/lib/merb-core/controller/ 
mixins/responder.rb:301 :in `to_sym'
/Library/Ruby/Gems/1.8/gems/merb-core-1.0.9/lib/merb-core/controller/ 
mixins/responder.rb:301 :in `_perform_content_negotiation'
/Library/Ruby/Gems/1.8/gems/merb-core-1.0.9/lib/merb-core/controller/ 
mixins/responder.rb:346 :in `content_type'
/Library/Ruby/Gems/1.8/gems/merb-core-1.0.9/lib/merb-core/controller/ 
mixins/render.rb:124 :in `render'
/Users/Mark/Sabado/Projects/myfamilycentral/app/controllers/ 
invitations.rb:17 :in `show'
/Library/Ruby/Gems/1.8/gems/merb-action-args-1.0.9/lib/merb-action- 
args/abstract_controller.rb:42 :in `__send__'
/Library/Ruby/Gems/1.8/gems/merb-action-args-1.0.9/lib/merb-action- 
args/abstract_controller.rb:42 :in `_call_action'
/Users/Mark/Sabado/Projects/myfamilycentral/app/controllers/ 
application.rb:38 :in `_call_action'
/Library/Ruby/Gems/1.8/gems/merb-core-1.0.9/lib/merb-core/controller/ 
abstract_controller.rb:289 :in `_dispatch'
/Library/Ruby/Gems/1.8/gems/merb-core-1.0.9/lib/merb-core/controller/ 
merb_controller.rb:252 :in `_dispatch'
/Library/Ruby/Gems/1.8/gems/merb-core-1.0.9/lib/merb-core/test/helpers/ 
mock_request_helper.rb:367 :in `dispatch_request'
/Library/Ruby/Gems/1.8/gems/merb-core-1.0.9/lib/merb-core/test/helpers/ 
mock_request_helper.rb:118 :in `dispatch_to'
/Library/Ruby/Gems/1.8/gems/merb-core-1.0.9/lib/merb-core/test/helpers/ 
mock_request_helper.rb:340 :in `mock_request'
/Library/Ruby/Gems/1.8/gems/merb-core-1.0.9/lib/merb-core/test/helpers/ 
mock_request_helper.rb:239 :in `get'
/Users/Mark/Sabado/Projects/myfamilycentral/spec/requests/ 
invitations_spec.rb:11

It appears that params[:format] is being set to "" instead of nil as  
in the request case. Then, _perform_content_negotiation fails at line  
301 of responder.rb as follows:

299    def _perform_content_negotiation
300      if fmt = params[:format]
301        accepts = [fmt.to_sym]
302      else
303        accepts = _accept_types

So, my question is whether I am using get incorrectly or whether this  
is a bug?

- Mark


Mark Lynn
Sabado Technologies
[email protected]




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"merb" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/merb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to