BUGFIX: missed a key rename

BUGFIX: API spec not enabling CSRF
This commit is contained in:
Sam 2014-05-23 08:42:58 +10:00
parent cf254000cf
commit 67db561429
2 changed files with 10 additions and 1 deletions

View file

@ -78,7 +78,7 @@ class Auth::DefaultCurrentUserProvider
# api has special rights return true if api was detected # api has special rights return true if api was detected
def is_api? def is_api?
current_user current_user
@env[API_KEY] @env[API_KEY_ENV]
end end
def has_auth_cookie? def has_auth_cookie?

View file

@ -130,6 +130,15 @@ describe TopicsController do
end end
describe 'api' do describe 'api' do
before do
ActionController::Base.allow_forgery_protection = true
end
after do
ActionController::Base.allow_forgery_protection = false
end
describe PostsController do describe PostsController do
let(:user) do let(:user) do
Fabricate(:user) Fabricate(:user)