Skip to content

Commit

Permalink
follow same naming scheme as other endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
one-m1nd committed Feb 28, 2024
1 parent 5167ac9 commit bd8a990
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/plants/resources/plants.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ module Resources
module Plants
# GET /plants
# @return [::HTTP::Response]
def plants
def list_plants
client.get('plants')
end

# GET /plants/{plant}
# @param plant [String]
# @return [::HTTP::Response]
def plant(plant)
def find_plant(plant)
client.get("plants/#{plant}")
end

Expand Down
8 changes: 4 additions & 4 deletions spec/plants_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,27 @@
end
end

describe '.plants' do
describe '.list_plants' do
before(:each) do
stub_request(:get, "#{Plants::Client::URL}/plants")
.to_return(status: 200, body: '{}')
end

subject { Plants.plants }
subject { Plants.list_plants }

it do
expect(subject).to be_instance_of(HTTP::Response)
expect(a_request(:get, "#{Plants::Client::URL}/plants")).to have_been_made
end
end

describe '.plant' do
describe '.find_plant' do
before(:each) do
stub_request(:get, "#{Plants::Client::URL}/plants/euphorbia-abdelkuri")
.to_return(status: 200, body: '{}')
end

subject { Plants.plant('euphorbia-abdelkuri') }
subject { Plants.find_plant('euphorbia-abdelkuri') }

it do
expect(subject).to be_instance_of(HTTP::Response)
Expand Down

0 comments on commit bd8a990

Please sign in to comment.