2017-03-08 01:42:24 -06:00
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
describe AboutController do
|
|
|
|
|
|
|
|
context '.index' do
|
|
|
|
|
|
|
|
it "should display the about page for anonymous user when login_required is false" do
|
|
|
|
SiteSetting.login_required = false
|
2018-05-21 22:40:50 -05:00
|
|
|
get "/about"
|
2017-08-30 23:06:56 -05:00
|
|
|
|
2018-06-05 02:29:17 -05:00
|
|
|
expect(response).to be_successful
|
2017-03-08 01:42:24 -06:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'should redirect to login page for anonymous user when login_required is true' do
|
|
|
|
SiteSetting.login_required = true
|
2018-05-21 22:40:50 -05:00
|
|
|
get "/about"
|
2017-08-30 23:06:56 -05:00
|
|
|
|
2017-03-08 01:42:24 -06:00
|
|
|
expect(response).to redirect_to '/login'
|
|
|
|
end
|
|
|
|
|
|
|
|
it "should display the about page for logged in user when login_required is true" do
|
|
|
|
SiteSetting.login_required = true
|
2018-05-21 22:40:50 -05:00
|
|
|
sign_in(Fabricate(:user))
|
|
|
|
get "/about"
|
2017-08-30 23:06:56 -05:00
|
|
|
|
2018-06-05 02:29:17 -05:00
|
|
|
expect(response).to be_successful
|
2017-03-08 01:42:24 -06:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|