Refactor login activity partial (remove inline ruby) (#28687)
This commit is contained in:
parent
204bbf49d2
commit
55802242ce
3 changed files with 62 additions and 9 deletions
|
@ -6,6 +6,7 @@ describe Settings::LoginActivitiesController do
|
|||
render_views
|
||||
|
||||
let!(:user) { Fabricate(:user) }
|
||||
let!(:login_activity) { Fabricate :login_activity, user: user }
|
||||
|
||||
before do
|
||||
sign_in user, scope: :user
|
||||
|
@ -19,6 +20,10 @@ describe Settings::LoginActivitiesController do
|
|||
it 'returns http success with private cache control headers', :aggregate_failures do
|
||||
expect(response).to have_http_status(200)
|
||||
expect(response.headers['Cache-Control']).to include('private, no-store')
|
||||
expect(response.body)
|
||||
.to include(login_activity.user_agent)
|
||||
.and include(login_activity.authentication_method)
|
||||
.and include(login_activity.ip.to_s)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue