File tree Expand file tree Collapse file tree
app/controllers/solidus_admin
spec/requests/solidus_admin Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -96,8 +96,6 @@ def resources_collection
9696 resource_class . all
9797 end
9898
99- def per_page ; end
100-
10199 def set_resource
102100 @resource ||= resource_class . find ( params [ :id ] ) . tap do |resource |
103101 instance_variable_set ( "@#{ resource_name } " , resource )
@@ -157,5 +155,15 @@ def after_update_path
157155 def after_destroy_path
158156 solidus_admin . send ( "#{ plural_resource_name } _path" , **search_filter_params )
159157 end
158+
159+ def blueprint
160+ raise NotImplementedError ,
161+ "You must implement the blueprint method in #{ self . class } "
162+ end
163+
164+ def blueprint_view
165+ raise NotImplementedError ,
166+ "You must implement the blueprint_view method in #{ self . class } "
167+ end
160168 end
161169end
Original file line number Diff line number Diff line change 1+ # frozen_string_literal: true
2+
3+ require "spec_helper"
4+
5+ RSpec . describe "SolidusAdmin::StatesController" , type : :request do
6+ let ( :admin_user ) { create ( :admin_user ) }
7+
8+ before do
9+ allow_any_instance_of ( SolidusAdmin ::BaseController ) . to receive ( :spree_current_user ) . and_return ( admin_user )
10+ end
11+
12+ describe "GET /index" do
13+ before { create_list ( :state , 3 ) }
14+
15+ it "serves json with a 200 OK status" do
16+ get solidus_admin . states_path
17+ expect ( response . headers [ "Content-Type" ] ) . to include ( "application/json" )
18+ expect ( response ) . to have_http_status ( :ok )
19+ expect ( JSON . parse ( response . body ) . size ) . to eq ( 3 )
20+ end
21+ end
22+ end
You can’t perform that action at this time.
0 commit comments