We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b4e5804 commit c6d0f37Copy full SHA for c6d0f37
test/unit/query_builder_test.rb
@@ -220,4 +220,19 @@ def test_can_specify_empty_string_filter_value
220
Article.where(:'author.id' => '').to_a
221
end
222
223
+ def test_scopes_are_nondestructive
224
+ first_stub = stub_request(:get, "http://example.com/articles?page[page]=1&page[per_page]=1")
225
+ .to_return(headers: {content_type: "application/vnd.api+json"}, body: { data: [] }.to_json)
226
+
227
+ all_stub = stub_request(:get, "http://example.com/articles")
228
229
230
+ scope = Article.where()
231
232
+ scope.first
233
+ scope.all
234
235
+ assert_requested first_stub, times: 1
236
+ assert_requested all_stub, times: 1
237
+ end
238
0 commit comments