mockjax 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/lib/mockjax.rb +1 -0
- data/lib/mockjax/version.rb +1 -1
- data/mockjax.gemspec +1 -0
- data/spec/requests_spec.rb +18 -5
- metadata +24 -13
data/README.md
CHANGED
data/lib/mockjax.rb
CHANGED
data/lib/mockjax/version.rb
CHANGED
data/mockjax.gemspec
CHANGED
data/spec/requests_spec.rb
CHANGED
@@ -1,12 +1,25 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe "Requests", :type => :request do
|
4
|
-
|
5
|
-
|
4
|
+
describe "mockjax helper" do
|
5
|
+
before do
|
6
|
+
mockjax url: '/api/foo', responseText: { message: 'bar' }
|
7
|
+
end
|
8
|
+
|
9
|
+
it "mocks the request" do
|
10
|
+
visit '/foo'
|
11
|
+
page.should have_content 'bar'
|
12
|
+
end
|
6
13
|
end
|
7
14
|
|
8
|
-
|
9
|
-
|
10
|
-
|
15
|
+
describe "stub_ajax helper" do
|
16
|
+
before do
|
17
|
+
stub_ajax url: '/api/foo', responseText: { message: 'bar' }
|
18
|
+
end
|
19
|
+
|
20
|
+
it "mocks the request" do
|
21
|
+
visit '/foo'
|
22
|
+
page.should have_content 'bar'
|
23
|
+
end
|
11
24
|
end
|
12
25
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mockjax
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,9 +11,20 @@ bindir: bin
|
|
11
11
|
cert_chain: []
|
12
12
|
date: 2012-06-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: json
|
16
|
+
requirement: &70360935142680 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *70360935142680
|
14
25
|
- !ruby/object:Gem::Dependency
|
15
26
|
name: rack
|
16
|
-
requirement: &
|
27
|
+
requirement: &70360935141560 !ruby/object:Gem::Requirement
|
17
28
|
none: false
|
18
29
|
requirements:
|
19
30
|
- - ! '>='
|
@@ -21,10 +32,10 @@ dependencies:
|
|
21
32
|
version: '0'
|
22
33
|
type: :runtime
|
23
34
|
prerelease: false
|
24
|
-
version_requirements: *
|
35
|
+
version_requirements: *70360935141560
|
25
36
|
- !ruby/object:Gem::Dependency
|
26
37
|
name: rake
|
27
|
-
requirement: &
|
38
|
+
requirement: &70360935140380 !ruby/object:Gem::Requirement
|
28
39
|
none: false
|
29
40
|
requirements:
|
30
41
|
- - ! '>='
|
@@ -32,10 +43,10 @@ dependencies:
|
|
32
43
|
version: '0'
|
33
44
|
type: :development
|
34
45
|
prerelease: false
|
35
|
-
version_requirements: *
|
46
|
+
version_requirements: *70360935140380
|
36
47
|
- !ruby/object:Gem::Dependency
|
37
48
|
name: rspec
|
38
|
-
requirement: &
|
49
|
+
requirement: &70360935139260 !ruby/object:Gem::Requirement
|
39
50
|
none: false
|
40
51
|
requirements:
|
41
52
|
- - ! '>='
|
@@ -43,10 +54,10 @@ dependencies:
|
|
43
54
|
version: '0'
|
44
55
|
type: :development
|
45
56
|
prerelease: false
|
46
|
-
version_requirements: *
|
57
|
+
version_requirements: *70360935139260
|
47
58
|
- !ruby/object:Gem::Dependency
|
48
59
|
name: sinatra
|
49
|
-
requirement: &
|
60
|
+
requirement: &70360935138620 !ruby/object:Gem::Requirement
|
50
61
|
none: false
|
51
62
|
requirements:
|
52
63
|
- - ! '>='
|
@@ -54,10 +65,10 @@ dependencies:
|
|
54
65
|
version: '0'
|
55
66
|
type: :development
|
56
67
|
prerelease: false
|
57
|
-
version_requirements: *
|
68
|
+
version_requirements: *70360935138620
|
58
69
|
- !ruby/object:Gem::Dependency
|
59
70
|
name: capybara
|
60
|
-
requirement: &
|
71
|
+
requirement: &70360935137940 !ruby/object:Gem::Requirement
|
61
72
|
none: false
|
62
73
|
requirements:
|
63
74
|
- - ! '>='
|
@@ -65,10 +76,10 @@ dependencies:
|
|
65
76
|
version: '0'
|
66
77
|
type: :development
|
67
78
|
prerelease: false
|
68
|
-
version_requirements: *
|
79
|
+
version_requirements: *70360935137940
|
69
80
|
- !ruby/object:Gem::Dependency
|
70
81
|
name: capybara-webkit
|
71
|
-
requirement: &
|
82
|
+
requirement: &70360935137320 !ruby/object:Gem::Requirement
|
72
83
|
none: false
|
73
84
|
requirements:
|
74
85
|
- - ! '>='
|
@@ -76,7 +87,7 @@ dependencies:
|
|
76
87
|
version: '0'
|
77
88
|
type: :development
|
78
89
|
prerelease: false
|
79
|
-
version_requirements: *
|
90
|
+
version_requirements: *70360935137320
|
80
91
|
description: Ruby gem for using jquery mockjax within rspec examples
|
81
92
|
email:
|
82
93
|
- eric@ejholmes.net
|