Comments (3)
Could you give an example of how you're currently using it, then how you would like to to be? I'm not sure I entirely understand.
from rspec_api_documentation.
In the example block below, in my get
method call, I have to define the full url and I believe that's because my application has a few subdomain constraints. Without the full host specified, the specs fail.
require 'spec_helper'
require 'rspec_api_documentation/dsl'
resource 'Albums' do
parameter :auth_token, 'Authentication token'
let(:user){ create(:user) }
let(:photo){ create(:photo, user: user) }
let(:auth_token){ user.authentication_token }
get 'https://app.example.com/api/v1/albums.json' do
before do
create(:album, user: user)
end
example_request 'List Albums' do
status.should == 200
response_json = JSON.parse(response_body)
response_json['errors'].should be_empty
albums = response_json['data']
albums.any?{ |album| album['name'] == 'Example Album' }.should be_true
end
end
end
from rspec_api_documentation.
I'm not entirely sure how to get around this. I think we have to mess with the env["HOST"]
which we can't get to from the DSL level and is client specific (rack, oauth). Issue #50 seems to be pretty similar. We can possibly add a new DSL to make the client change the host properly. Seems like it might be a good way around this.
from rspec_api_documentation.
Related Issues (20)
- Document multiple examples for the same endpoint
- Request headers missing when using :open_api
- Docs generation fails if upload multiple files in a test case HOT 2
- Get `NoMethodError` when there is an example that expect an api to raise 500 error HOT 5
- Can't name parameter "pending" HOT 1
- Rails 5.2 update fixture changes
- Maintenance status HOT 23
- Can we please opt-in to Hacktoberfest? 🙏🏻 HOT 4
- No ability to generate a nullable option on response fields
- Add support for context blocks in HTML index HOT 3
- Open api: Ability to add description for scope
- Sample linked in README is not working HOT 1
- Bug in OpenApi formatter with multiple examples for same HTTP action? HOT 2
- Example site is offline HOT 1
- How To: Run tests in parallel and generate documentation HOT 2
- Allow to use short example definition
- Support for the latest version of Ruby
- EOFError on trying to test upload apis without file
- Support for OAS 3.1?
- Support ruby 3.2, DEPRECATED File.exists? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rspec_api_documentation.