beanstalkd_view 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,7 +8,7 @@ shared_examples 'integration_test' do
8
8
  end
9
9
  end
10
10
 
11
- it "should show error at site root" do
11
+ it "should should error at site root" do
12
12
  visit site_root
13
13
  page.should have_content "Could not connect"
14
14
  end
@@ -22,74 +22,14 @@ shared_examples 'integration_test' do
22
22
  end
23
23
  end
24
24
 
25
- it "should show the overview at: /" do
26
- visit site_root
27
- body.should have_content "Beanstalkd View"
28
- body.should have_content "Statistics"
29
- body.should have_content "Tubes"
30
- end
31
-
32
- it "should show the default tube stats at: tube/default" do
33
- visit "#{site_root}tube/default"
34
- body.should have_content "Beanstalkd View"
35
- body.should have_content "Statistics"
25
+ it_behaves_like "queue_browser" do
26
+ let(:tube_name) { 'test.tube' }
36
27
  end
37
28
 
38
- it "show be able to add a job on the overview page", :js => true do
39
- visit site_root
40
- form = find('#add_job_form')
41
- form.fill_in 'form_tube_name', :with => 'test.tube'
42
- form.fill_in 'form_job_body', :with => '{"id": 1, "name": "Bob"}'
43
- form.click_link('Add Job')
44
- body.should have_content "Add new job?"
45
- click_link "confirm_add_job_btn"
46
- body.should have_content "Added job:"
29
+ it_behaves_like "queue_browser" do
30
+ let(:tube_name) { 'test/tube' }
47
31
  end
48
32
 
49
- it "show be able to click on the test.tube link (created by the last test)", :js => true do
50
- visit site_root
51
- click_link('test.tube')
52
- body.should have_content "test.tube"
53
- end
54
-
55
- it "show be able to peek_range and see job (created by the last test)", :js => true do
56
- visit site_root
57
- form = find('#peek_range_form')
58
- form.fill_in 'min', :with => '0'
59
- form.fill_in 'max', :with => '0'
60
- click_button 'Peek'
61
- body.should have_content "Peek Range"
62
- end
63
-
64
- it "show be able to pause a tube", :js => true do
65
- visit "#{site_root}/tube/test.tube"
66
- form = find('#pause_form')
67
- form.fill_in 'delay', :with => 1
68
- click_button "Pause"
69
- body.should have_content "Paused test.tube"
70
- end
71
-
72
- it "show be able to kick a tube", :js => true do
73
- visit "#{site_root}tube/test.tube"
74
- form = find('#kick_form')
75
- form.fill_in 'bound', :with => 1
76
- click_button "Kick"
77
- body.should have_content "Kicked test.tube"
78
- end
79
-
80
- it "show be able to peek_ready a tube", :js => true do
81
- visit "#{site_root}tube/test.tube"
82
- click_link('peek_ready_btn')
83
- body.should have_content "Job id:"
84
- end
85
-
86
- it "show be able to clear a tube", :js => true do
87
- visit "#{site_root}/tube/test.tube"
88
- form = find('#clear_form')
89
- form.select 'Buried', :from => 'state'
90
- click_button "Clear"
91
- body.should have_content "Cleared all buried jobs from test.tube"
92
- end
93
33
  end
94
34
 
95
35
  describe "with two beanstalkd daemons running", :requires_two_beanstalkd => true do
@@ -100,31 +40,17 @@ shared_examples 'integration_test' do
100
40
  end
101
41
  end
102
42
 
103
- it "should show the overview at: /" do
43
+ it "should show the overview at: /", :requires_two_beanstalkd => true do
104
44
  visit site_root
105
45
  body.should have_content "Beanstalkd View"
106
46
  body.should have_content "Statistics"
107
47
  body.should have_content "Tubes"
108
48
  end
109
49
 
110
- it "show be able to add a job on the overview page, and view its stats", :js => true do
111
- visit site_root
112
- form = find('#add_job_form')
113
- form.fill_in 'form_tube_name', :with => 'test.tube'
114
- form.fill_in 'form_job_body', :with => '{"id": 1, "name": "Bob"}'
115
- form.click_link('Add Job')
116
- body.should have_content "Add new job?"
117
- click_link "confirm_add_job_btn"
118
- body.should have_content "Added job:"
119
-
120
- visit site_root
121
- click_link('test.tube')
122
- body.should have_content "test.tube"
123
-
124
- visit "#{site_root}tube/test.tube"
125
- click_link('peek_ready_btn')
126
- body.should have_content "Job id:"
50
+ it_behaves_like "queue_browser", :requires_two_beanstalkd => true do
51
+ let(:tube_name) { 'test.two' }
127
52
  end
53
+
128
54
  end
129
55
 
130
56
  end
@@ -0,0 +1,72 @@
1
+ shared_examples 'queue_browser' do
2
+
3
+ it "should show the overview at: /" do
4
+ visit site_root
5
+ body.should have_content "Beanstalkd View"
6
+ body.should have_content "Statistics"
7
+ body.should have_content "Tubes"
8
+ end
9
+
10
+ it "should show the default tube stats at: tube/default" do
11
+ visit "#{site_root}tube/default"
12
+ body.should have_content "Beanstalkd View"
13
+ body.should have_content "Statistics"
14
+ end
15
+
16
+ it "should be able to add a job on the overview page", :js => true do
17
+ visit site_root
18
+ form = find('#add_job_form')
19
+ form.fill_in 'form_tube_name', :with => tube_name
20
+ form.fill_in 'form_job_body', :with => '{"id": 1, "name": "Bob"}'
21
+ form.click_link('Add Job')
22
+ body.should have_content "Add new job?"
23
+ click_link "confirm_add_job_btn"
24
+ body.should have_content "Added job:"
25
+ end
26
+
27
+ it "should be able to click on the tube_name link (created by the last test)", :js => true do
28
+ visit site_root
29
+ click_link('test.tube')
30
+ body.should have_content "test.tube"
31
+ end
32
+
33
+ it "should be able to peek_range and see job (created by the last test)", :js => true do
34
+ visit site_root
35
+ form = find('#peek_range_form')
36
+ form.fill_in 'min', :with => '0'
37
+ form.fill_in 'max', :with => '0'
38
+ click_button 'Peek'
39
+ body.should have_content "Peek Range"
40
+ end
41
+
42
+ it "should be able to pause a tube", :js => true do
43
+ visit "#{site_root}/tube/#{CGI::escape(tube_name)}"
44
+ form = find('#pause_form')
45
+ form.fill_in 'delay', :with => 1
46
+ click_button "Pause"
47
+ body.should have_content "Paused #{tube_name}"
48
+ end
49
+
50
+ it "should be able to kick a tube", :js => true do
51
+ visit "#{site_root}tube/#{CGI::escape(tube_name)}"
52
+ form = find('#kick_form')
53
+ form.fill_in 'bound', :with => 1
54
+ click_button "Kick"
55
+ body.should have_content "Kicked #{tube_name}"
56
+ end
57
+
58
+ it "should be able to peek_ready a tube", :js => true do
59
+ visit "#{site_root}tube/#{CGI::escape(tube_name)}"
60
+ click_link('peek_ready_btn')
61
+ body.should have_content "Job id:"
62
+ end
63
+
64
+ it "should be able to clear a tube", :js => true do
65
+ visit "#{site_root}/tube/#{CGI::escape(tube_name)}"
66
+ form = find('#clear_form')
67
+ form.select 'Buried', :from => 'state'
68
+ click_button "Clear"
69
+ body.should have_content "Cleared all buried jobs from #{tube_name}"
70
+ end
71
+
72
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beanstalkd_view
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  prerelease:
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: 2012-07-27 00:00:00.000000000 Z
12
+ date: 2013-02-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sinatra
@@ -66,7 +66,7 @@ dependencies:
66
66
  requirements:
67
67
  - - ~>
68
68
  - !ruby/object:Gem::Version
69
- version: 0.1.0
69
+ version: 0.3.0
70
70
  type: :runtime
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
@@ -74,7 +74,7 @@ dependencies:
74
74
  requirements:
75
75
  - - ~>
76
76
  - !ruby/object:Gem::Version
77
- version: 0.1.0
77
+ version: 0.3.0
78
78
  - !ruby/object:Gem::Dependency
79
79
  name: vegas
80
80
  requirement: !ruby/object:Gem::Requirement
@@ -229,6 +229,7 @@ files:
229
229
  - spec/rails_helper.rb
230
230
  - spec/spec_helper.rb
231
231
  - spec/support/integration_test_shared_examples.rb
232
+ - spec/support/queue_browser_shared_examples.rb
232
233
  homepage: https://github.com/denniskuczynski/beanstalkd_view
233
234
  licenses: []
234
235
  post_install_message:
@@ -243,7 +244,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
243
244
  version: '0'
244
245
  segments:
245
246
  - 0
246
- hash: -720595023102186338
247
+ hash: 389499898497922155
247
248
  required_rubygems_version: !ruby/object:Gem::Requirement
248
249
  none: false
249
250
  requirements:
@@ -252,10 +253,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
252
253
  version: '0'
253
254
  segments:
254
255
  - 0
255
- hash: -720595023102186338
256
+ hash: 389499898497922155
256
257
  requirements: []
257
258
  rubyforge_project:
258
- rubygems_version: 1.8.24
259
+ rubygems_version: 1.8.25
259
260
  signing_key:
260
261
  specification_version: 3
261
262
  summary: A Sinatra app to view/manage beanstalkd queues that can be embedded in a
@@ -269,3 +270,4 @@ test_files:
269
270
  - spec/rails_helper.rb
270
271
  - spec/spec_helper.rb
271
272
  - spec/support/integration_test_shared_examples.rb
273
+ - spec/support/queue_browser_shared_examples.rb