Remove v0 version namespacing for API

This commit is contained in:
Thibault Jouan
2012-03-18 23:16:43 +00:00
parent 5dfafdcc46
commit 10a8e1f094
10 changed files with 11 additions and 13 deletions

View File

@@ -0,0 +1,29 @@
require 'spec_helper'
feature 'API sign in' do
let(:user) { Factory.create(:user) }
def do_create
post api_sessions_path, :format => :json, :session => {
:email => user.email,
:password => user.password
}
end
scenario 'signs the user in with valid credentials' do
do_create
response.should be_success
(JSON response.body).should include 'id'
end
[:email, :password].each do |attr|
scenario "rejects authentication with invalid credentials (#{attr})" do
user.stub(attr => user.send(attr) + '_INVALID')
do_create
response.should be_not_found
response.body.should be_empty
end
end
end