Skip to content
Snippets Groups Projects
Commit 79024a65 authored by Paul Gascou-Vaillancourt's avatar Paul Gascou-Vaillancourt
Browse files

Fix and cleanup helper specs

parent b0377bcb
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -11,15 +11,18 @@
let(:ci_variables_documentation_path) { help_page_path('ci/variables/README') }
let(:project_ci_settings_path) { project_settings_ci_cd_path(project) }
 
subject { helper.api_fuzzing_configuration_data(project) }
before do
allow(helper).to receive(:current_user).and_return(user)
end
describe '#api_fuzzing_configuration_data' do
context 'as a developer' do
context 'user without set_pipeline_variables policy' do
before do
helper.instance_variable_set(:@current_user, user)
allow(helper).to receive(:can?).with(user, :set_pipeline_variables, project).and_return(true)
end
 
subject { helper.api_fuzzing_configuration_data(project) }
it {
is_expected.to eq(
full_path: full_path,
Loading
Loading
@@ -32,14 +35,11 @@
}
end
 
context 'as a maintainer' do
context 'user with set_pipeline_variables policy' do
before do
helper.instance_variable_set(:@current_user, user)
allow(helper).to receive(:can?).with(user, :set_pipeline_variables, project).and_return(false)
end
 
subject { helper.api_fuzzing_configuration_data(project) }
it {
is_expected.to eq(
full_path: full_path,
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment