/
multidomain_support.feature
71 lines (63 loc) 路 1.92 KB
/
multidomain_support.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
Feature: mutidomain support
In your `.service.yml` list you domains in form `hostname: url`
To deploy statically on other domain and be able to send API requests
you should turn off Access-Control-Allow-Origin restriction
in config/application.rb (Rails 4)
```ruby
config.action_dispatch.default_headers = {
'Access-Control-Allow-Origin' => '<YOUR STATIC SERVER>',
'Access-Control-Request-Method' => 'GET, PUT, POST, DELETE, OPTIONS'
}
```
@javascript
Scenario: json schema gets generated into html preview using "users/destroy"
Given an empty directory named "html"
And a file named "lurker/LurkerApp.service.yml" with:
"""yml
---
basePath: ''
description: ''
domains:
'[Sandbox] Heroku': 'http://lurker-app.herokuapp.com'
'[Real] razum2um.me': 'http://lurker.razum2um.me'
name: Lurker Demo Application
extensions: {}
"""
And a file named "lurker/api/v1/users/__id-DELETE.json.yml" with:
"""yml
---
prefix: users management
description: user deletion
requestParameters:
properties:
id:
type: integer
example: 1
responseCodes:
- status: 200
successful: true
description: ''
responseParameters:
properties: {}
extensions:
method: DELETE
path_info: "/api/v1/users/1.json"
path_params:
controller: api/v1/users
action: destroy
id: 1
"""
When I successfully run `bin/lurker convert`
Then the output should contain these lines:
"""
Converting lurker to html
using lurker
create index.html
create api/v1/users/__id-DELETE.html
"""
When I go to "/lurker/api/v1/users/__id-DELETE.html"
When I select "[Sandbox] Heroku" hostname
Then I should see:
"""
curl -X DELETE "http://lurker-app.herokuapp.com/api/v1/users/1"
"""