-
-
Notifications
You must be signed in to change notification settings - Fork 929
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix rubocop problems in event previews
- Loading branch information
1 parent
d4e37f0
commit c72d751
Showing
3 changed files
with
25 additions
and
47 deletions.
There are no files selected for viewing
23 changes: 8 additions & 15 deletions
23
test/components/previews/events/rubygem_event/version/pushed_component_preview.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,12 @@ | ||
class Events::RubygemEvent::Version::PushedComponentPreview < Lookbook::Preview | ||
def default(rubygem: Rubygem.first!, # rubocop:disable Metrics/ParameterLists | ||
number: "1.0.0", platform: "ruby", | ||
version_gid: rubygem.versions.where(number:, platform:).first&.to_gid, | ||
pushed_by: "Pusher", actor_gid: version_gid&.find&.pusher&.to_gid) | ||
event = FactoryBot.build(:events_rubygem_event, rubygem:, tag: Events::RubygemEvent::VERSION_PUSHED, additional: | ||
{ | ||
number:, | ||
platform:, | ||
pushed_by:, | ||
def default(rubygem: Rubygem.first!, **additional) | ||
additional[:number] ||= "1.0.0" | ||
additional[:platform] ||= "ruby" | ||
additional[:version_gid] ||= rubygem.versions.where(number:, platform:).first&.to_gid | ||
additional[:pushed_by] ||= "Pusher" | ||
additional[:actor_gid] ||= version_gid.find.pusher.to_gid if additional[:version_gid] | ||
|
||
version_gid:, | ||
actor_gid: | ||
}) | ||
render Events::RubygemEvent::Version::PushedComponent.new( | ||
event: | ||
) | ||
event = FactoryBot.build(:events_rubygem_event, rubygem:, tag: Events::RubygemEvent::VERSION_PUSHED, additional:) | ||
render Events::RubygemEvent::Version::PushedComponent.new(event:) | ||
end | ||
end |
26 changes: 9 additions & 17 deletions
26
test/components/previews/events/rubygem_event/version/yank_forbidden_component_preview.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,13 @@ | ||
class Events::RubygemEvent::Version::YankForbiddenComponentPreview < Lookbook::Preview | ||
def default(rubygem: Rubygem.first!, # rubocop:disable Metrics/ParameterLists | ||
reason: "Versions used for testing can't be yanked.", | ||
number: "0.0.1", platform: "ruby", | ||
version_gid: rubygem.versions.where(number:, platform:).first&.to_gid, | ||
yanked_by: "Yanker", actor_gid: version_gid&.find&.yanker&.to_gid) | ||
event = FactoryBot.build(:events_rubygem_event, rubygem:, tag: Events::RubygemEvent::VERSION_YANK_FORBIDDEN, additional: | ||
{ | ||
number:, | ||
platform:, | ||
yanked_by:, | ||
def default(rubygem: Rubygem.first!, **additional) | ||
additional[:reason] ||= "Versions used for testing can't be yanked." | ||
additional[:number] ||= "0.0.1" | ||
additional[:platform] ||= "ruby" | ||
additional[:version_gid] ||= rubygem.versions.where(number:, platform:).first&.to_gid | ||
additional[:yanked_by] ||= "Yanker" | ||
additional[:actor_gid] ||= version_gid.find.yanker.to_gid if additional[:version_gid] | ||
|
||
version_gid:, | ||
actor_gid:, | ||
reason: | ||
}) | ||
render Events::RubygemEvent::Version::YankForbiddenComponent.new( | ||
event: | ||
) | ||
event = FactoryBot.build(:events_rubygem_event, rubygem:, tag: Events::RubygemEvent::VERSION_YANK_FORBIDDEN, additional:) | ||
render Events::RubygemEvent::Version::YankForbiddenComponent.new(event:) | ||
end | ||
end |
23 changes: 8 additions & 15 deletions
23
test/components/previews/events/rubygem_event/version/yanked_component_preview.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,12 @@ | ||
class Events::RubygemEvent::Version::YankedComponentPreview < Lookbook::Preview | ||
def default(rubygem: Rubygem.first!, # rubocop:disable Metrics/ParameterLists | ||
number: "0.0.1", platform: "ruby", | ||
version_gid: rubygem.versions.where(number:, platform:).first&.to_gid, | ||
yanked_by: "Yanker", actor_gid: version_gid&.find&.yanker&.to_gid) | ||
event = FactoryBot.build(:events_rubygem_event, rubygem:, tag: Events::RubygemEvent::VERSION_YANKED, additional: | ||
{ | ||
number:, | ||
platform:, | ||
yanked_by:, | ||
def default(rubygem: Rubygem.first!, **additional) | ||
additional[:number] ||= "0.0.1" | ||
additional[:platform] ||= "ruby" | ||
additional[:version_gid] ||= rubygem.versions.where(number:, platform:).first&.to_gid | ||
additional[:yanked_by] ||= "Yanker" | ||
additional[:actor_gid] ||= version_gid.find.yanker.to_gid if additional[:version_gid] | ||
|
||
version_gid:, | ||
actor_gid: | ||
}) | ||
render Events::RubygemEvent::Version::YankedComponent.new( | ||
event: | ||
) | ||
event = FactoryBot.build(:events_rubygem_event, rubygem:, tag: Events::RubygemEvent::VERSION_YANKED, additional:) | ||
render Events::RubygemEvent::Version::YankedComponent.new(event:) | ||
end | ||
end |