Skip to content

Commit 3dc2af6

Browse files
committed
Add a scenario for using subdomain constrained routes
1 parent 211d7d9 commit 3dc2af6

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

features/request_specs/request_spec.feature

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,3 +152,23 @@ Feature: request spec
152152
"""
153153
When I run `rspec spec`
154154
Then the example should pass
155+
156+
Scenario: testing subdomain constrained requests
157+
Given a file named "spec/requests/widgets_spec.rb" with:
158+
"""ruby
159+
require "rails_helper"
160+
161+
RSpec.describe "Widget management", :type => :request do
162+
before { host! "api.example.com" }
163+
164+
it "creates a Widget" do
165+
headers = { "ACCEPT" => "application/json" }
166+
post "/widgets", :params => { :widget => {:name => "My Widget"} }, :headers => headers
167+
168+
expect(response.content_type).to eq("application/json; charset=utf-8")
169+
expect(response).to have_http_status(:created)
170+
end
171+
end
172+
"""
173+
When I run `rspec spec`
174+
Then the example should pass

0 commit comments

Comments
 (0)