test/lib/godmin/resources/resource_service/scopes_test.rb in godmin-0.12.0 vs test/lib/godmin/resources/resource_service/scopes_test.rb in godmin-0.12.1
- old
+ new
@@ -1,20 +1,20 @@
require "test_helper"
module Godmin
module ResourceService
class ScopesTest < ActiveSupport::TestCase
- class NoScopesService
- include Godmin::Resources::ResourceService
- end
-
def setup
- @article_service = ArticleService.new
+ @article_service = Fakes::ArticleService.new
end
def test_returns_resources_when_no_scopes_are_defined
- @foo_thing = NoScopesService.new
- assert_equal :resources, @foo_thing.apply_scope("", :resources)
+ service_class = Class.new do
+ include Godmin::Resources::ResourceService
+ end
+
+ service = service_class.new
+ assert_equal :resources, service.apply_scope("", :resources)
end
def test_calls_default_scope
@article_service.apply_scope("", :resources)
assert_equal :resources, @article_service.called_methods[:scopes][:unpublished]