Commit 75acd425 authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch 'issue_344279_create_spec_graphql' into 'master'

Fix Style/OpenStructUse offenses for quick actions and import specs

See merge request gitlab-org/gitlab!75238
parents 32d9bb9a ce54ba05
......@@ -17,7 +17,5 @@ Style/OpenStructUse:
- spec/helpers/profiles_helper_spec.rb
- spec/lib/gitlab/gitaly_client/blobs_stitcher_spec.rb
- spec/lib/gitlab/gitaly_client/diff_stitcher_spec.rb
- spec/lib/gitlab/legacy_github_import/project_creator_spec.rb
- spec/lib/gitlab/quick_actions/command_definition_spec.rb
- spec/services/system_note_service_spec.rb
- spec/support/helpers/repo_helpers.rb
......@@ -7,7 +7,7 @@ RSpec.describe Gitlab::LegacyGithubImport::ProjectCreator do
let(:namespace) { create(:group) }
let(:repo) do
OpenStruct.new(
ActiveSupport::InheritableOptions.new(
login: 'vim',
name: 'vim',
full_name: 'asd/vim',
......@@ -21,7 +21,7 @@ RSpec.describe Gitlab::LegacyGithubImport::ProjectCreator do
namespace.add_owner(user)
expect_next_instance_of(Project) do |project|
expect(project).to receive(:add_import_job)
allow(project).to receive(:add_import_job)
end
end
......
......@@ -26,7 +26,7 @@ RSpec.describe Gitlab::QuickActions::CommandDefinition do
describe "#noop?" do
context "when the command has an action block" do
before do
subject.action_block = proc { }
subject.action_block = proc {}
end
it "returns false" do
......@@ -42,7 +42,7 @@ RSpec.describe Gitlab::QuickActions::CommandDefinition do
end
describe "#available?" do
let(:opts) { OpenStruct.new(go: false) }
let(:opts) { ActiveSupport::InheritableOptions.new(go: false) }
context "when the command has a condition block" do
before do
......@@ -104,7 +104,8 @@ RSpec.describe Gitlab::QuickActions::CommandDefinition do
end
describe "#execute" do
let(:context) { OpenStruct.new(run: false, commands_executed_count: nil) }
let(:fake_context) { Struct.new(:run, :commands_executed_count, :received_arg) }
let(:context) { fake_context.new(false, nil, nil) }
context "when the command is a noop" do
it "doesn't execute the command" do
......
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