Skip to content
This repository was archived by the owner on Apr 4, 2025. It is now read-only.

Commit 8d3e8b4

Browse files
committed
Rename FindRaid -> ShowRaid
While this Interactor might still be too simple for it's own object, I'm taking the steps to ensure the Interactor names aren't REST-ish but indicative of the actual use case being handled.
1 parent d8e9660 commit 8d3e8b4

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

app/controllers/raids_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def update
3939
protected
4040

4141
def find_raid(id)
42-
FindRaid.new.by_id id.to_i
42+
ShowRaid.new.by_id id.to_i
4343
end
4444

4545
def schedule_raid(raid = nil)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
##
55
# NOTE: Is this too simple for an Interactor?
66
##
7-
class FindRaid
7+
class ShowRaid
88

99
def by_id(id)
1010
Repository.for(Raid).find(id)

test/integration/raids_controller_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class RaidsControllerTest < ActionController::TestCase
3131
login_as_user
3232

3333
@raid = Raid.new when: Date.today, start_at: Time.now, invite_at: Time.now
34-
FindRaid.any_instance.expects(:by_id).with(10).returns(@raid)
34+
ShowRaid.any_instance.expects(:by_id).with(10).returns(@raid)
3535
ListCharacters.any_instance.stubs(:run).returns([])
3636
end
3737

@@ -99,7 +99,7 @@ class RaidsControllerTest < ActionController::TestCase
9999
login_as_user
100100

101101
raid = Raid.new
102-
FindRaid.any_instance.expects(:by_id).with(10).returns(raid)
102+
ShowRaid.any_instance.expects(:by_id).with(10).returns(raid)
103103

104104
get :edit, :id => 10
105105

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
require 'unit/test_helper'
2-
require 'interactors/find_raid'
2+
require 'interactors/show_raid'
33

4-
describe FindRaid do
4+
describe ShowRaid do
55

66
it "exists" do
7-
FindRaid.new.wont_be_nil
7+
ShowRaid.new.wont_be_nil
88
end
99

1010
it "can find a raid by id" do
1111
Repository.for(Raid).save Raid.new(where: "ICC", id: 1)
1212

13-
action = FindRaid.new
13+
action = ShowRaid.new
1414

1515
r = action.by_id 1
1616
r.wont_be_nil

0 commit comments

Comments
 (0)