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