Skip to content

Commit d37665f

Browse files
committed
Allow document to be passed into resource
1 parent 2a3ff0b commit d37665f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/rspec_api_documentation/dsl.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def self.resource(*args, &block)
208208
options = if args.last.is_a?(Hash) then args.pop else {} end
209209
options[:api_docs_dsl] = true
210210
options[:resource_name] = args.first
211-
options[:document] = :all
211+
options[:document] ||= :all
212212
args.push(options)
213213
describe(*args, &block)
214214
end

spec/dsl_spec.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,3 +458,9 @@
458458
example.metadata[:parameters].length.should == 1
459459
end
460460
end
461+
462+
resource "passing in document to resource", :document => :not_all do
463+
it "should have the correct tag" do
464+
example.metadata[:document].should == :not_all
465+
end
466+
end

0 commit comments

Comments
 (0)