spec/apitizer/routing/node_spec.rb in apitizer-0.0.2 vs spec/apitizer/routing/node_spec.rb in apitizer-0.0.3

- old
+ new

@@ -8,11 +8,11 @@ it 'finds final destinations' do expect(root.trace(steps)).to be_kind_of(Apitizer::Routing::Path) end end - shared_examples 'an adequate collection guard' do |only: restful_actions| + shared_examples 'an adequate collection guard' do |only = restful_actions| (restful_collection_actions & only).each do |action| it "permits #{ action } actions" do path = root.trace(steps) expect(path.permit?(action)).to be_truthy end @@ -31,11 +31,11 @@ expect(path.permit?(action)).to be_falsy end end end - shared_examples 'an adequate member guard' do |only: restful_actions| + shared_examples 'an adequate member guard' do |only = restful_actions| (restful_member_actions & only).each do |action| it "permites #{ action } actions" do path = root.trace(steps) expect(path.permit?(action)).to be_truthy end @@ -94,16 +94,16 @@ let(:root) { create_tree([ :articles, only ]) } context 'when looking for collections' do let(:steps) { [ :articles ] } it_behaves_like 'an adequate pathfinder' - it_behaves_like 'an adequate collection guard', only: only + it_behaves_like 'an adequate collection guard', only end context 'when looking for members' do let(:steps) { [ :articles, 'xxx' ] } it_behaves_like 'an adequate pathfinder' - it_behaves_like 'an adequate member guard', only: only + it_behaves_like 'an adequate member guard', only end end restful_actions.each do |action| context "when defining #{ action } operations" do