Skip to content

Instantly share code, notes, and snippets.

@vidmantas
Created June 25, 2012 14:08
Show Gist options
  • Save vidmantas/2988862 to your computer and use it in GitHub Desktop.
Save vidmantas/2988862 to your computer and use it in GitHub Desktop.
undefined method 'post'
# file located spec/mapi/v1/authentication_spec.rb
# exception:
# NoMethodError:
# undefined method `post' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_1:0xc652514>
# # ./spec/mapi/v1/authentication_spec.rb:6:in `block (3 levels) in <top (required)>'
require 'spec_helper'
describe Mapi::V1::SessionsController, :type => :api do
context 'unsuccessful authentication' do
it 'should not authenticate on wrong credentials' do
post '/mapi/v1/login', email: 'john.doe@mail.dk', password: 'wrong', device_id: '123456789abc'
response.code.should == '401'
JSON.parse(response.body).should == { :maintenance => 0 }
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment