File tree Expand file tree Collapse file tree 4 files changed +14
-13
lines changed
Expand file tree Collapse file tree 4 files changed +14
-13
lines changed Original file line number Diff line number Diff line change 7070 end
7171
7272 it "successfully calls before_scim_response" do
73- expect { get :resource_user } . to change { counter . count } . from ( 0 ) . to ( 1 )
73+ expect { get :resource_user } . to change { counter . before_called } . from ( 0 ) . to ( 1 )
7474 end
7575 end
7676
8585 ScimRails . config . after_scim_response = nil
8686 end
8787
88- it "successfully calls before_scim_response " do
89- expect { get :resource_user } . to change { counter . count } . from ( 0 ) . to ( 2 )
88+ it "successfully calls after_scim_response " do
89+ expect { get :resource_user } . to change { counter . after_called } . from ( 0 ) . to ( 1 )
9090 end
9191 end
9292 end
154154 end
155155
156156 it "successfully calls before_scim_response" do
157- expect { get :resource_group } . to change { counter . count } . from ( 0 ) . to ( 1 )
157+ expect { get :resource_group } . to change { counter . before_called } . from ( 0 ) . to ( 1 )
158158 end
159159 end
160160
170170 end
171171
172172 it "successfully calls before_scim_response" do
173- expect { get :resource_group } . to change { counter . count } . from ( 0 ) . to ( 2 )
173+ expect { get :resource_group } . to change { counter . after_called } . from ( 0 ) . to ( 1 )
174174 end
175175 end
176176 end
Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ module ScimRails
7777 end
7878
7979 it "successfully calls before_scim_response" do
80- expect { get :get_schema , params : { id : 1 } } . to change { counter . count } . from ( 0 ) . to ( 1 )
80+ expect { get :get_schema , params : { id : 1 } } . to change { counter . before_called } . from ( 0 ) . to ( 1 )
8181 end
8282 end
8383
@@ -93,7 +93,7 @@ module ScimRails
9393 end
9494
9595 it "successfully calls after_scim_response" do
96- expect { get :get_schema , params : { id : 1 } } . to change { counter . count } . from ( 0 ) . to ( 2 )
96+ expect { get :get_schema , params : { id : 1 } } . to change { counter . after_called } . from ( 0 ) . to ( 1 )
9797 end
9898 end
9999 end
Original file line number Diff line number Diff line change 7070 end
7171
7272 it "successfully calls before_scim_response" do
73- expect { get :configuration } . to change { counter . count } . from ( 0 ) . to ( 1 )
73+ expect { get :configuration } . to change { counter . before_called } . from ( 0 ) . to ( 1 )
7474 end
7575 end
7676
8686 end
8787
8888 it "successfully calls after_scim_response" do
89- expect { get :configuration } . to change { counter . count } . from ( 0 ) . to ( 2 )
89+ expect { get :configuration } . to change { counter . after_called } . from ( 0 ) . to ( 1 )
9090 end
9191 end
9292 end
Original file line number Diff line number Diff line change 11module CallbackHelper
22 class CallbackCounter
3- attr_reader :count
3+ attr_reader :before_called , :after_called
44 attr_accessor :before , :after
55
66 def initialize
7- @count = 0
7+ @before_called = 0
8+ @after_called = 0
89
910 @before = lambda do
10- @count += 1
11+ @before_called += 1
1112 end
1213
1314 @after = lambda do
14- @count += 2
15+ @after_called += 1
1516 end
1617 end
1718 end
You can’t perform that action at this time.
0 commit comments