agile-proxy 0.1.9 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +3 -1
- data/lib/agile_proxy/handlers/stub_handler.rb +1 -1
- data/lib/agile_proxy/model/application.rb +2 -2
- data/lib/agile_proxy/model/request_spec.rb +2 -1
- data/lib/agile_proxy/version.rb +1 -1
- data/spec/integration/helpers/request_spec_helper.rb +6 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b0ac0c54c3b6fbb655ba9996eeb3a2d994be8e1
|
4
|
+
data.tar.gz: 029090ba04333c73aabec281024e6a172e53d54f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6393cc970654e874f2756aeca50474a8ad1e1b5118c0fa07d6520629c0610addddc87d2cbc3225c798008a9d7c8065f358a2abf96ba166c1e980597ede380f65
|
7
|
+
data.tar.gz: d8b6e4455fca2fb1983a27c6864e97629819cbb07ba260df1465443429e5401fae127e6e360c9a6b67424e5ac61a09a9e9049799ec37cdfdc632a74ef8cec795
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -101,4 +101,6 @@ http://public-app-1:password@localhost:3100
|
|
101
101
|
3. Multi Application - The current infrastructure supports it, just need UI support - can already be done using REST
|
102
102
|
|
103
103
|
## History
|
104
|
-
v0.1.8 Added support for plain text params parser - As DWR uses this (and maybe others)
|
104
|
+
v0.1.8 Added support for plain text params parser - As DWR uses this (and maybe others)
|
105
|
+
v0.1.9 Plain text params parser bug fixed - now handles params with a key and no value
|
106
|
+
v0.1.10 Now using dependent: :destroy to tidy up better when all specs for an application are deleted (common occurence)
|
@@ -26,7 +26,7 @@ module AgileProxy
|
|
26
26
|
username, password = username_password env
|
27
27
|
@route_set = ActionDispatch::Routing::RouteSet.new
|
28
28
|
|
29
|
-
my_short_list = short_list(username, password, request.request_method, request.url).all.to_a
|
29
|
+
my_short_list = short_list(username, password, request.request_method, request.url).all.to_a.reverse
|
30
30
|
headers = downcased_headers(env)
|
31
31
|
body = request.body.read
|
32
32
|
request.body.rewind
|
@@ -13,8 +13,8 @@ module AgileProxy
|
|
13
13
|
#
|
14
14
|
class Application < ActiveRecord::Base
|
15
15
|
belongs_to :user
|
16
|
-
has_many :request_specs
|
17
|
-
has_many :recordings
|
16
|
+
has_many :request_specs, :dependent => :destroy
|
17
|
+
has_many :recordings, :dependent => :delete_all
|
18
18
|
validates_uniqueness_of :password, scope: :username
|
19
19
|
end
|
20
20
|
end
|
@@ -16,9 +16,10 @@ module AgileProxy
|
|
16
16
|
class RequestSpec < ActiveRecord::Base
|
17
17
|
belongs_to :application
|
18
18
|
belongs_to :user
|
19
|
-
belongs_to :response
|
19
|
+
belongs_to :response, :dependent => :destroy
|
20
20
|
accepts_nested_attributes_for :response
|
21
21
|
validates_inclusion_of :url_type, in: %w(url regex)
|
22
|
+
validates_presence_of :application_id
|
22
23
|
def initialize(attrs = {})
|
23
24
|
attrs[:http_method] = attrs.delete(:method) if attrs.key?(:method)
|
24
25
|
super
|
data/lib/agile_proxy/version.rb
CHANGED
@@ -34,20 +34,21 @@ module AgileProxy
|
|
34
34
|
configure_applications
|
35
35
|
# Now, add some stubs via the REST interface
|
36
36
|
[@http_url, @https_url].each do |url|
|
37
|
+
create_request_spec url: "#{url}/index.html", response: { content_type: 'text/html', content: '<html><body>This Is An Older Mock</body></html>' } #This is intentional - the system should always use the latest
|
37
38
|
create_request_spec url: "#{url}/index.html", response: { content_type: 'text/html', content: '<html><body>Mocked Content</body></html>' }
|
38
39
|
create_request_spec url: "#{url}/api/forums", response: { content_type: 'application/json', content: JSON.pretty_generate(forums: [], total: 0) }
|
39
40
|
create_request_spec url: "#{url}/api/forums", http_method: 'POST', response: { content_type: 'application/json', content: '{"created": true}' }
|
40
|
-
create_request_spec url: "#{url}/api/forums/:forum_id/posts", response: { content_type: 'application/json', content: JSON.pretty_generate(posts: [
|
41
|
-
{ forum_id: '{{forum_id}}', subject: 'My first post' },
|
42
|
-
{ forum_id: '{{forum_id}}', subject: 'My second post' },
|
43
|
-
{ forum_id: '{{forum_id}}', subject: 'My third post' }
|
44
|
-
], total: 3), is_template: true }
|
45
41
|
create_request_spec url: "#{url}/api/forums/:forum_id/:post_id", response: { content_type: 'text/html', content: '<html><body><h1>Sorted By: {{sort}}</h1><h2>{{forum_id}}</h2><h3>{{post_id}}</h3></body></html>', is_template: true }
|
46
42
|
create_request_spec url: "#{url}/api/forums/:forum_id/:post_id", http_method: 'PUT', response: { content_type: 'application/json', content: '{"updated": true}' }
|
47
43
|
create_request_spec url: "#{url}/api/forums/:forum_id/:post_id", http_method: 'DELETE', response: { content_type: 'application/json', content: '{"deleted": true}' }
|
48
44
|
create_request_spec url: "#{url}/api/forums/:forum_id/:post_id", conditions: '{"post_id": "special"}', response: { content_type: 'text/html', content: '<html><body><h1>Sorted By: {{sort}}</h1><h2>{{forum_id}}</h2><h3>{{post_id}}</h3><p>This is a special response</p></body></html>', is_template: true }
|
49
45
|
create_request_spec url: "#{url}/api/forums/:forum_id/:post_id", conditions: '{"post_id": "special", "sort": "eversospecial"}', response: { content_type: 'text/html', content: '<html><body><h1>Sorted By: {{sort}}</h1><h2>{{forum_id}}</h2><h3>{{post_id}}</h3><p>This is an ever so special response</p></body></html>', is_template: true }
|
50
46
|
create_request_spec url: "#{url}/api/forums/:forum_id", http_method: 'POST', conditions: '{"posted_var":"special_value"}', response: { content_type: 'text/html', content: '<html><body><h1></h1><h2>{{posted_var}}</h2><h3>{{forum_id}}</h3><p>This should get data from the POSTed data</p></body></html>', is_template: true }
|
47
|
+
create_request_spec url: "#{url}/api/forums/:forum_id/posts", response: { content_type: 'application/json', content: JSON.pretty_generate(posts: [
|
48
|
+
{ forum_id: '{{forum_id}}', subject: 'My first post' },
|
49
|
+
{ forum_id: '{{forum_id}}', subject: 'My second post' },
|
50
|
+
{ forum_id: '{{forum_id}}', subject: 'My third post' }
|
51
|
+
], total: 3), is_template: true }
|
51
52
|
end
|
52
53
|
end
|
53
54
|
before :each do
|