mirage 3.0.0.alpha.14 → 3.0.0.alpha.15
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/features/templates/{body.feature → preview.feature} +1 -1
- data/mirage.gemspec +3 -3
- data/server/server.rb +2 -4
- data/spec/server/server_spec.rb +2 -2
- data/views/response.haml +1 -1
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.0.0.alpha.
|
1
|
+
3.0.0.alpha.15
|
data/mirage.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "mirage"
|
8
|
-
s.version = "3.0.0.alpha.
|
8
|
+
s.version = "3.0.0.alpha.15"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Leon Davis"]
|
12
|
-
s.date = "2013-08-
|
12
|
+
s.date = "2013-08-21"
|
13
13
|
s.description = "Mirage aids testing of your applications by hosting mock responses so that your applications do not have to talk to real endpoints. Its accessible via HTTP and has a RESTful interface."
|
14
14
|
s.executables = ["mirage"]
|
15
15
|
s.extra_rdoc_files = [
|
@@ -50,9 +50,9 @@ Gem::Specification.new do |s|
|
|
50
50
|
"features/support/hooks.rb",
|
51
51
|
"features/support/mirage.rb",
|
52
52
|
"features/support/web.rb",
|
53
|
-
"features/templates/body.feature",
|
54
53
|
"features/templates/delete.feature",
|
55
54
|
"features/templates/get.feature",
|
55
|
+
"features/templates/preview.feature",
|
56
56
|
"features/templates/put.feature",
|
57
57
|
"features/templates/put_with_substitutions.feature",
|
58
58
|
"features/templates/readme.md",
|
data/server/server.rb
CHANGED
@@ -38,10 +38,8 @@ module Mirage
|
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
|
-
get '/templates/:id/
|
42
|
-
|
43
|
-
content_type(response.response_spec['content_type'])
|
44
|
-
response.value '', {}, ''
|
41
|
+
get '/templates/:id/preview' do
|
42
|
+
send_response(MockResponse.find_by_id(response_id), '', {}, '')
|
45
43
|
end
|
46
44
|
|
47
45
|
delete '/templates/:id' do
|
data/spec/server/server_spec.rb
CHANGED
@@ -33,12 +33,12 @@ describe "Mirage Server" do
|
|
33
33
|
end
|
34
34
|
|
35
35
|
context '/templates' do
|
36
|
-
describe '
|
36
|
+
describe '/preview' do
|
37
37
|
it 'should give the value' do
|
38
38
|
response_body = 'hello'
|
39
39
|
content_type = 'application/javascript'
|
40
40
|
response_id = JSON.parse(put('/templates/greeting', {:response => {:body => Base64.encode64(response_body), :content_type => content_type}}.to_json).body)['id']
|
41
|
-
response = get("/templates/#{response_id}/
|
41
|
+
response = get("/templates/#{response_id}/preview")
|
42
42
|
response.body.should == response_body
|
43
43
|
response.content_type.should include(content_type)
|
44
44
|
end
|
data/views/response.haml
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
%div
|
4
4
|
%label{:style => 'font-weight: bold'}
|
5
5
|
endpoint:
|
6
|
-
%a{href: "/templates/#{response.response_id}/
|
6
|
+
%a{href: "/templates/#{response.response_id}/preview"} #{response.name}
|
7
7
|
%span -:-
|
8
8
|
%a{href: "/requests/#{response.response_id}"} Track
|
9
9
|
%br
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mirage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.0.alpha.
|
4
|
+
version: 3.0.0.alpha.15
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-08-
|
12
|
+
date: 2013-08-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sinatra
|
@@ -279,9 +279,9 @@ files:
|
|
279
279
|
- features/support/hooks.rb
|
280
280
|
- features/support/mirage.rb
|
281
281
|
- features/support/web.rb
|
282
|
-
- features/templates/body.feature
|
283
282
|
- features/templates/delete.feature
|
284
283
|
- features/templates/get.feature
|
284
|
+
- features/templates/preview.feature
|
285
285
|
- features/templates/put.feature
|
286
286
|
- features/templates/put_with_substitutions.feature
|
287
287
|
- features/templates/readme.md
|
@@ -354,7 +354,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
354
354
|
version: '0'
|
355
355
|
segments:
|
356
356
|
- 0
|
357
|
-
hash:
|
357
|
+
hash: -3864215664462087330
|
358
358
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
359
359
|
none: false
|
360
360
|
requirements:
|