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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9debf529ce58a4c1b629a0fcb240cbea68d2ad8b
4
- data.tar.gz: cf140a73a3794a97a14f1f420d23762f70a7aeaa
3
+ metadata.gz: 9b0ac0c54c3b6fbb655ba9996eeb3a2d994be8e1
4
+ data.tar.gz: 029090ba04333c73aabec281024e6a172e53d54f
5
5
  SHA512:
6
- metadata.gz: 4f84ca76bfc4a8e8305ce22a83ad494210de26e8b4d5121cd018f79a4c87cc29306635116fe92823653a894b620f1294113942e90a58ad1520f7b10bff972965
7
- data.tar.gz: 9e6da7607628bc29d4dda9d17c5d6481b27098aa53c02029efae899bf20431627f6729af915f979d8e614f577b56e519e9d5dd8b1af21b39e361359057721f6d
6
+ metadata.gz: 6393cc970654e874f2756aeca50474a8ad1e1b5118c0fa07d6520629c0610addddc87d2cbc3225c798008a9d7c8065f358a2abf96ba166c1e980597ede380f65
7
+ data.tar.gz: d8b6e4455fca2fb1983a27c6864e97629819cbb07ba260df1465443429e5401fae127e6e360c9a6b67424e5ac61a09a9e9049799ec37cdfdc632a74ef8cec795
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- agile-proxy (0.1.9)
4
+ agile-proxy (0.1.10)
5
5
  activerecord (~> 4.1.6)
6
6
  em-http-request (~> 1.1.2)
7
7
  em-synchrony (~> 1.0.3)
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
@@ -2,5 +2,5 @@
2
2
  #
3
3
  # The Agile Proxy module is a common namespace for all classes / sub modules.
4
4
  module AgileProxy
5
- VERSION = '0.1.9'
5
+ VERSION = '0.1.10'
6
6
  end
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: agile-proxy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gary Taylor