summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/controllers/application_controller.rb2
-rw-r--r--spec/controllers/application_controller_spec.rb8
-rw-r--r--spec/models/personal_access_token_spec.rb2
3 files changed, 6 insertions, 6 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index c8baea2579b..23a0e16ca43 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -368,7 +368,7 @@ class ApplicationController < ActionController::Base
# From https://github.com/plataformatec/devise/wiki/How-To:-Simple-Token-Authentication-Example
# https://gist.github.com/josevalim/fb706b1e933ef01e4fb6
def get_user_from_private_token
- user_token = params[:private_token].presence || request.headers['PRIVATE-TOKEN'].presence
+ user_token = params[:private_token].presence || request.headers['PRIVATE-TOKEN'].presence
User.find_by_authentication_token(user_token.to_s) if user_token
end
diff --git a/spec/controllers/application_controller_spec.rb b/spec/controllers/application_controller_spec.rb
index ff596e7c2ad..ff5b3916273 100644
--- a/spec/controllers/application_controller_spec.rb
+++ b/spec/controllers/application_controller_spec.rb
@@ -62,8 +62,8 @@ describe ApplicationController do
it "doesn't log the user in otherwise" do
@request.headers['PRIVATE-TOKEN'] = "token"
get :index, private_token: "token", authenticity_token: "token"
- expect(response.status).to_not eq(200)
- expect(response.body).to_not eq("authenticated")
+ expect(response.status).not_to eq(200)
+ expect(response.body).not_to eq("authenticated")
end
end
@@ -96,8 +96,8 @@ describe ApplicationController do
it "doesn't log the user in otherwise" do
get :index, private_token: "token"
- expect(response.status).to_not eq(200)
- expect(response.body).to_not eq('authenticated')
+ expect(response.status).not_to eq(200)
+ expect(response.body).not_to eq('authenticated')
end
end
end
diff --git a/spec/models/personal_access_token_spec.rb b/spec/models/personal_access_token_spec.rb
index 3e80a48175a..46eb71cef14 100644
--- a/spec/models/personal_access_token_spec.rb
+++ b/spec/models/personal_access_token_spec.rb
@@ -9,7 +9,7 @@ describe PersonalAccessToken, models: true do
it "doesn't save the record" do
personal_access_token = PersonalAccessToken.generate({})
- expect(personal_access_token).to_not be_persisted
+ expect(personal_access_token).not_to be_persisted
end
end
end