Skip to content

Fix resolving object from request with overridden uri#167

Open
MisterBolt wants to merge 2 commits into
balvig:mainfrom
MisterBolt:fix_object_resolving_from_custom_uri
Open

Fix resolving object from request with overridden uri#167
MisterBolt wants to merge 2 commits into
balvig:mainfrom
MisterBolt:fix_object_resolving_from_custom_uri

Conversation

@MisterBolt

Copy link
Copy Markdown
Contributor

I can't edit PR so created new one.
This is old with conversation: #163

@balvig

balvig commented Nov 4, 2025

Copy link
Copy Markdown
Owner

Hey @MisterBolt!
Just getting around to give this a proper look, but could you help give a bit more context?
Maybe add a test that would fail on main?

There is an existing test that suggests this should already be working, so I'm wondering what issue you were seeing:

def test_custom_get_request_from_class
endpoint = stub_request(:get, 'http://sushi.com/recipes/recent').to_return_json(result: [{ id: 1, title: 'Bread' }])
recipes = Recipe.with('/recipes/recent').get
assert_equal %w{ Bread }, recipes.map(&:title)
assert_requested endpoint
end

The main difference from the code you shared is the new call (which I'm not sure how is being used in the example):

    def self.create(params)
      with("fcc-add-records").new.post(params)
    end

    def self.update(params)
      with("fcc-update-records").new.post(params)
    end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants