Remove the access_password site setting

This commit is contained in:
Neil Lalonde
2013-06-25 15:05:16 -04:00
parent 9a19c0d9c4
commit a86b35c873
30 changed files with 40 additions and 295 deletions

View File

@ -122,24 +122,6 @@ describe InvitesController do
end
context 'access_required' do
it "doesn't set a cookie for access if there is no access required" do
SiteSetting.stubs(:access_password).returns(nil)
Invite.any_instance.expects(:redeem).returns(user)
get :show, id: invite.invite_key
cookies[:_access].should be_blank
end
it "sets the cookie when access is required" do
SiteSetting.stubs(:access_password).returns('adventure time!')
Invite.any_instance.expects(:redeem).returns(user)
get :show, id: invite.invite_key
cookies[:_access].should == 'adventure time!'
end
end
end
end

View File

@ -1,56 +0,0 @@
require 'spec_helper'
describe RequestAccessController do
context '.new' do
it "sets a default return path" do
get :new
assigns(:return_path).should == "/"
end
it "assigns the return path we provide" do
get :new, return_path: '/asdf'
assigns(:return_path).should == "/asdf"
end
end
context '.create' do
context 'without an invalid password' do
before do
post :create, password: 'asdf'
end
it "adds a flash" do
flash[:error].should be_present
end
it "doesn't set the cookie" do
cookies[:_access].should be_blank
end
end
context 'with a valid password' do
before do
SiteSetting.stubs(:access_password).returns 'test password'
post :create, password: 'test password', return_path: '/the-path'
end
it 'creates the cookie' do
cookies[:_access].should == 'test password'
end
it 'redirects to the return path' do
response.should redirect_to('/the-path')
end
it 'sets no flash error' do
flash[:error].should be_blank
end
end
end
end

View File

@ -16,12 +16,5 @@ describe RobotsTxtController do
response.should render_template :no_index
end
it "serves noindex when in private mode regardless of the configuration" do
SiteSetting.stubs(:allow_index_in_robots_txt).returns(true)
SiteSetting.stubs(:access_password).returns('adventure time!')
get :index
response.should render_template :no_index
end
end
end