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 CHANGED
@@ -41,7 +41,7 @@ Then define your stubs like you would with any other stubbing library:
41
41
 
42
42
  ```ruby
43
43
  before do
44
- mockjax url: '/test', responseText: { message: 'hello world' }
44
+ stub_ajax url: '/test', responseText: { message: 'hello world' }
45
45
  end
46
46
  ```
47
47
 
@@ -34,6 +34,7 @@ module Mockjax
34
34
  def mockjax(*args)
35
35
  Mockjax.mock(*args)
36
36
  end
37
+ alias :stub_ajax :mockjax
37
38
  end
38
39
  end
39
40
 
@@ -1,3 +1,3 @@
1
1
  module Mockjax
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -15,6 +15,7 @@ Gem::Specification.new do |gem|
15
15
  gem.require_paths = ["lib"]
16
16
  gem.version = Mockjax::VERSION
17
17
 
18
+ gem.add_dependency 'json'
18
19
  gem.add_dependency 'rack'
19
20
 
20
21
  gem.add_development_dependency 'rake'
@@ -1,12 +1,25 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe "Requests", :type => :request do
4
- before do
5
- mockjax url: '/api/foo', responseText: { message: 'bar' }
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
- it "mocks the request" do
9
- visit '/foo'
10
- page.should have_content 'bar'
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.2
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: &70099612608660 !ruby/object:Gem::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: *70099612608660
35
+ version_requirements: *70360935141560
25
36
  - !ruby/object:Gem::Dependency
26
37
  name: rake
27
- requirement: &70099612607720 !ruby/object:Gem::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: *70099612607720
46
+ version_requirements: *70360935140380
36
47
  - !ruby/object:Gem::Dependency
37
48
  name: rspec
38
- requirement: &70099612606340 !ruby/object:Gem::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: *70099612606340
57
+ version_requirements: *70360935139260
47
58
  - !ruby/object:Gem::Dependency
48
59
  name: sinatra
49
- requirement: &70099612605220 !ruby/object:Gem::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: *70099612605220
68
+ version_requirements: *70360935138620
58
69
  - !ruby/object:Gem::Dependency
59
70
  name: capybara
60
- requirement: &70099612604620 !ruby/object:Gem::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: *70099612604620
79
+ version_requirements: *70360935137940
69
80
  - !ruby/object:Gem::Dependency
70
81
  name: capybara-webkit
71
- requirement: &70099612603860 !ruby/object:Gem::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: *70099612603860
90
+ version_requirements: *70360935137320
80
91
  description: Ruby gem for using jquery mockjax within rspec examples
81
92
  email:
82
93
  - eric@ejholmes.net