resque-web 0.0.3 → 0.0.4

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.
Files changed (26) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +32 -0
  3. data/app/assets/stylesheets/resque_web/{bootstrap_and_overrides.css → bootstrap_and_overrides.css.erb} +1 -1
  4. data/app/controllers/resque_web/application_controller.rb +9 -1
  5. data/app/views/layouts/resque_web/application.html.erb +1 -1
  6. data/app/views/resque_web/failures/index.html.erb +1 -1
  7. data/app/views/resque_web/workers/show.html.erb +2 -2
  8. data/app/views/resque_web/working/_working.html.erb +2 -2
  9. data/config/initializers/resque_config.rb +0 -1
  10. data/lib/resque_web/tabs.rb +21 -0
  11. data/lib/resque_web/version.rb +1 -1
  12. data/test/dummy/log/development.log +2108 -0
  13. data/test/dummy/log/test.log +392 -0
  14. data/test/dummy/tmp/cache/assets/development/sprockets/373b0c58027ae58f732cc7e48e62a522 +0 -0
  15. data/test/dummy/tmp/cache/assets/development/sprockets/4d22200fb380d8ae9d5f07525088622f +0 -0
  16. data/test/dummy/tmp/cache/assets/development/sprockets/77c22795a818c14728d95acd9587b669 +0 -0
  17. data/test/dummy/tmp/cache/assets/development/sprockets/8fbf100e961e22baca23d1850b41e4d5 +0 -0
  18. data/test/dummy/tmp/cache/assets/development/sprockets/b4d13aa7c0619b532c51ba11cf25a61c +0 -0
  19. data/test/dummy/tmp/cache/assets/development/sprockets/cfedb3b22e14b70300291f97fb8376e5 +0 -0
  20. data/test/dummy/tmp/pids/server.pid +1 -0
  21. data/test/functional/failures_controller_test.rb +10 -9
  22. data/test/functional/overview_controller_test.rb +34 -4
  23. data/test/functional/queues_controller_test.rb +4 -1
  24. data/test/support/controller_test_helpers.rb +22 -0
  25. metadata +14 -5
  26. data/test/dummy/config/initializers/wat.rb +0 -1
@@ -1,7 +1,37 @@
1
1
  require 'test_helper'
2
2
 
3
- class OverviewControllerTest < ActionController::TestCase
4
- # test "the truth" do
5
- # assert true
6
- # end
3
+ module ResqueWeb
4
+
5
+ class OverviewControllerTest < ActionController::TestCase
6
+ include ControllerTestHelpers
7
+
8
+ setup do
9
+ @routes = Engine.routes
10
+ end
11
+
12
+ describe "GET /" do
13
+ describe "when HTTP Basic Authentication is enabled" do
14
+ describe "and the currect username and password are supplied " do
15
+ it "should grant me access" do
16
+ visit(:show)
17
+ assert_response :ok
18
+ end
19
+ end
20
+
21
+ describe "and the username and password are not supplied" do
22
+ it "should deny me access" do
23
+ visit(:show, {}, :auth => false)
24
+ assert_response :unauthorized
25
+ end
26
+ end
27
+ end
28
+
29
+ describe "when HTTP Basic Authentication is disabled" do
30
+ it "should grant me access" do
31
+ visit(:show, {}, :auth => :disabled)
32
+ assert_response :ok
33
+ end
34
+ end
35
+ end
36
+ end
7
37
  end
@@ -2,16 +2,19 @@ require 'test_helper'
2
2
 
3
3
  module ResqueWeb
4
4
  class QueuesControllerTest < ActionController::TestCase
5
+ include ControllerTestHelpers
6
+
5
7
  setup do
6
8
  @routes = Engine.routes
7
9
  end
10
+
8
11
  let(:queue_name) { 'example_queue' }
9
12
 
10
13
  it "deletes queues" do
11
14
  Resque.push(queue_name, :class => 'ExampleJob')
12
15
  Resque.queues.include?(queue_name).must_equal true
13
16
 
14
- delete :destroy, :id => queue_name
17
+ visit(:destroy, {:id => queue_name}, :method => :delete)
15
18
  assert_redirected_to queues_path
16
19
 
17
20
  Resque.queues.include?(queue_name).wont_equal true
@@ -0,0 +1,22 @@
1
+ module ControllerTestHelpers
2
+ def visit(action, params = {}, options = {})
3
+ method = options.delete(:method) || :get
4
+
5
+ user = ENV["RESQUE_WEB_HTTP_BASIC_AUTH_USER"]
6
+ password = ENV["RESQUE_WEB_HTTP_BASIC_AUTH_PASSWORD"]
7
+
8
+ if options[:auth] == :disabled
9
+ ENV["RESQUE_WEB_HTTP_BASIC_AUTH_USER"] = nil
10
+ ENV["RESQUE_WEB_HTTP_BASIC_AUTH_PASSWORD"] = nil
11
+ else
12
+ request.env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials(
13
+ options[:user] || user, options[:password] || password
14
+ ) unless options[:auth] == false
15
+ end
16
+
17
+ send(method, action, params)
18
+
19
+ ENV["RESQUE_WEB_HTTP_BASIC_AUTH_USER"] = user
20
+ ENV["RESQUE_WEB_HTTP_BASIC_AUTH_PASSWORD"] = password
21
+ end
22
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resque-web
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tony Arcieri
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-20 00:00:00.000000000 Z
11
+ date: 2013-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: resque
@@ -113,8 +113,8 @@ files:
113
113
  - app/helpers/resque_web/queues_helper.rb
114
114
  - app/helpers/resque_web/working_helper.rb
115
115
  - app/helpers/resque_web/failures_helper.rb
116
+ - app/assets/stylesheets/resque_web/bootstrap_and_overrides.css.erb
116
117
  - app/assets/stylesheets/resque_web/application.css
117
- - app/assets/stylesheets/resque_web/bootstrap_and_overrides.css
118
118
  - app/assets/javascripts/resque_web/jquery.relative-date.js
119
119
  - app/assets/javascripts/resque_web/bootstrap.js.coffee
120
120
  - app/assets/javascripts/resque_web/application.js
@@ -133,6 +133,7 @@ files:
133
133
  - config/initializers/resque_config.rb
134
134
  - config/routes.rb
135
135
  - lib/resque_web.rb
136
+ - lib/resque_web/tabs.rb
136
137
  - lib/resque_web/engine.rb
137
138
  - lib/resque_web/version.rb
138
139
  - Rakefile
@@ -146,6 +147,7 @@ files:
146
147
  - test/unit/helpers/jobs_helper_test.rb
147
148
  - test/unit/helpers/working_helper_test.rb
148
149
  - test/unit/helpers/failures_helper_test.rb
150
+ - test/support/controller_test_helpers.rb
149
151
  - test/functional/working_controller_test.rb
150
152
  - test/functional/failures_controller_test.rb
151
153
  - test/functional/stats_controller_test.rb
@@ -163,7 +165,6 @@ files:
163
165
  - test/dummy/config/initializers/filter_parameter_logging.rb
164
166
  - test/dummy/config/initializers/inflections.rb
165
167
  - test/dummy/config/initializers/session_store.rb
166
- - test/dummy/config/initializers/wat.rb
167
168
  - test/dummy/config/initializers/wrap_parameters.rb
168
169
  - test/dummy/config/initializers/mime_types.rb
169
170
  - test/dummy/config/initializers/backtrace_silencers.rb
@@ -172,6 +173,7 @@ files:
172
173
  - test/dummy/config/routes.rb
173
174
  - test/dummy/config/application.rb
174
175
  - test/dummy/config/boot.rb
176
+ - test/dummy/tmp/pids/server.pid
175
177
  - test/dummy/tmp/cache/assets/development/sprockets/8d0a322f394a2e12a350a4caf9b2c80e
176
178
  - test/dummy/tmp/cache/assets/development/sprockets/9f48e8c551b5f898ca5667d92067e33d
177
179
  - test/dummy/tmp/cache/assets/development/sprockets/9048f98bf002a866ef7831c71f7124d6
@@ -187,11 +189,14 @@ files:
187
189
  - test/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655
188
190
  - test/dummy/tmp/cache/assets/development/sprockets/b02ffe2d07d7ce606d1c3a0656d82bfe
189
191
  - test/dummy/tmp/cache/assets/development/sprockets/4d22200fb380d8ae9d5f07525088622f
192
+ - test/dummy/tmp/cache/assets/development/sprockets/cfedb3b22e14b70300291f97fb8376e5
190
193
  - test/dummy/tmp/cache/assets/development/sprockets/c7f7c001ba2ad5623ead9e6f2d6188e9
191
194
  - test/dummy/tmp/cache/assets/development/sprockets/36bf84c5368755f6fbc0c1808cfe7c5d
192
195
  - test/dummy/tmp/cache/assets/development/sprockets/d9f00b466d45c065d1281b100de9311f
193
196
  - test/dummy/tmp/cache/assets/development/sprockets/267d0243760c55e0ff8039158fbfa98d
197
+ - test/dummy/tmp/cache/assets/development/sprockets/77c22795a818c14728d95acd9587b669
194
198
  - test/dummy/tmp/cache/assets/development/sprockets/a0113b5b044a3468edab999708723b3d
199
+ - test/dummy/tmp/cache/assets/development/sprockets/b4d13aa7c0619b532c51ba11cf25a61c
195
200
  - test/dummy/tmp/cache/assets/development/sprockets/4ef303154e5471cbc5a1b7b312a5fbd3
196
201
  - test/dummy/tmp/cache/assets/development/sprockets/14882e8f1f7d019b37950944b1053585
197
202
  - test/dummy/tmp/cache/assets/development/sprockets/32fdb0387d5cd8aba5f0185f10ccaf6b
@@ -408,6 +413,7 @@ test_files:
408
413
  - test/unit/helpers/jobs_helper_test.rb
409
414
  - test/unit/helpers/working_helper_test.rb
410
415
  - test/unit/helpers/failures_helper_test.rb
416
+ - test/support/controller_test_helpers.rb
411
417
  - test/functional/working_controller_test.rb
412
418
  - test/functional/failures_controller_test.rb
413
419
  - test/functional/stats_controller_test.rb
@@ -425,7 +431,6 @@ test_files:
425
431
  - test/dummy/config/initializers/filter_parameter_logging.rb
426
432
  - test/dummy/config/initializers/inflections.rb
427
433
  - test/dummy/config/initializers/session_store.rb
428
- - test/dummy/config/initializers/wat.rb
429
434
  - test/dummy/config/initializers/wrap_parameters.rb
430
435
  - test/dummy/config/initializers/mime_types.rb
431
436
  - test/dummy/config/initializers/backtrace_silencers.rb
@@ -434,6 +439,7 @@ test_files:
434
439
  - test/dummy/config/routes.rb
435
440
  - test/dummy/config/application.rb
436
441
  - test/dummy/config/boot.rb
442
+ - test/dummy/tmp/pids/server.pid
437
443
  - test/dummy/tmp/cache/assets/development/sprockets/8d0a322f394a2e12a350a4caf9b2c80e
438
444
  - test/dummy/tmp/cache/assets/development/sprockets/9f48e8c551b5f898ca5667d92067e33d
439
445
  - test/dummy/tmp/cache/assets/development/sprockets/9048f98bf002a866ef7831c71f7124d6
@@ -449,11 +455,14 @@ test_files:
449
455
  - test/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655
450
456
  - test/dummy/tmp/cache/assets/development/sprockets/b02ffe2d07d7ce606d1c3a0656d82bfe
451
457
  - test/dummy/tmp/cache/assets/development/sprockets/4d22200fb380d8ae9d5f07525088622f
458
+ - test/dummy/tmp/cache/assets/development/sprockets/cfedb3b22e14b70300291f97fb8376e5
452
459
  - test/dummy/tmp/cache/assets/development/sprockets/c7f7c001ba2ad5623ead9e6f2d6188e9
453
460
  - test/dummy/tmp/cache/assets/development/sprockets/36bf84c5368755f6fbc0c1808cfe7c5d
454
461
  - test/dummy/tmp/cache/assets/development/sprockets/d9f00b466d45c065d1281b100de9311f
455
462
  - test/dummy/tmp/cache/assets/development/sprockets/267d0243760c55e0ff8039158fbfa98d
463
+ - test/dummy/tmp/cache/assets/development/sprockets/77c22795a818c14728d95acd9587b669
456
464
  - test/dummy/tmp/cache/assets/development/sprockets/a0113b5b044a3468edab999708723b3d
465
+ - test/dummy/tmp/cache/assets/development/sprockets/b4d13aa7c0619b532c51ba11cf25a61c
457
466
  - test/dummy/tmp/cache/assets/development/sprockets/4ef303154e5471cbc5a1b7b312a5fbd3
458
467
  - test/dummy/tmp/cache/assets/development/sprockets/14882e8f1f7d019b37950944b1053585
459
468
  - test/dummy/tmp/cache/assets/development/sprockets/32fdb0387d5cd8aba5f0185f10ccaf6b
@@ -1 +0,0 @@
1
- ResqueWeb.add_tab('shoot', :wat)