File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -152,3 +152,23 @@ Feature: request spec
152
152
"""
153
153
When I run `rspec spec`
154
154
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
You can’t perform that action at this time.
0 commit comments