Module: Committee::Rails::Test::Methods
- Includes:
- Test::Methods
- Defined in:
- lib/committee/rails/test/methods.rb
Instance Method Summary collapse
- #committee_options ⇒ Object
- #committee_schema ⇒ Object
- #default_schema ⇒ Object
- #request_object ⇒ Object
- #response_data ⇒ Object
Instance Method Details
#committee_options ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/committee/rails/test/methods.rb', line 11 def if defined?(RSpec) && ( = RSpec.try(:configuration).try(:committee_options)) elsif !defined?(@committee_schema) { schema: default_schema } else # schema_url_prefix method call this but the user overrite comittee_schema, we got error # we can remove in comittee 3.x { schema: committee_schema } end end |
#committee_schema ⇒ Object
6 7 8 9 |
# File 'lib/committee/rails/test/methods.rb', line 6 def committee_schema # this code for 2.4.0, committee 3.x use committee_options @committee_schema ||= Committee::Middleware::Base.new(nil, ).send(:get_schema, ) end |
#default_schema ⇒ Object
23 24 25 |
# File 'lib/committee/rails/test/methods.rb', line 23 def default_schema @default_schema ||= Committee::Drivers.load_from_file(Rails.root.join('docs', 'schema', 'schema.json').to_s) end |
#request_object ⇒ Object
27 28 29 |
# File 'lib/committee/rails/test/methods.rb', line 27 def request_object request end |
#response_data ⇒ Object
31 32 33 |
# File 'lib/committee/rails/test/methods.rb', line 31 def response_data [response.status, response.headers, response.body] end |