Commit 85296e80 authored by Sean Arnold's avatar Sean Arnold

Update specs and controller method name

parent b30593ff
......@@ -41,7 +41,7 @@ module EE
project.feature_available?(:tracing, current_user)
end
def has_status_page_licence?
def has_status_page_license?
project.feature_available?(:status_page, current_user)
end
......@@ -62,7 +62,7 @@ module EE
permitted_params[:tracing_setting_attributes] = [:external_url]
end
if has_status_page_licence?
if has_status_page_license?
permitted_params.merge!(status_page_setting_params)
end
......
......@@ -11,7 +11,7 @@ describe OperationsHelper do
before do
helper.instance_variable_set(:@project, project)
allow(helper).to receive(:current_user).and_return(user)
allow(helper).to receive(:current_user) { user }
allow(helper)
.to receive(:can?).with(user, :admin_operations, project) { true }
end
......@@ -31,8 +31,15 @@ describe OperationsHelper do
)
end
it 'returns nil or true for the values' do
expect(subject.values.uniq).to contain_exactly('true', nil)
it 'returns the correct values' do
expect(subject).to eq(
'user-can-enable-status-page' => 'true',
'setting-enabled' => nil,
'setting-aws-access-key' => nil,
'setting-masked-aws-secret-key' => nil,
'setting-aws-region' => nil,
'setting-aws-s3-bucket-name' => nil
)
end
context 'user does not have permission' do
......@@ -41,8 +48,15 @@ describe OperationsHelper do
.to receive(:can?).with(user, :admin_operations, project) { false }
end
it 'returns nil or true for the values' do
expect(subject.values.uniq).to contain_exactly('false', nil)
it 'returns the correct values' do
expect(subject).to eq(
'user-can-enable-status-page' => 'false',
'setting-enabled' => nil,
'setting-aws-access-key' => nil,
'setting-masked-aws-secret-key' => nil,
'setting-aws-region' => nil,
'setting-aws-s3-bucket-name' => nil
)
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment