rocketjob_mission_control 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +1 -1
- data/app/assets/images/rocket_job_mission_control/rocket-icon-512x512.png +0 -0
- data/app/assets/images/rocket_job_mission_control/rocket-icon-64x64.png +0 -0
- data/app/assets/stylesheets/rocket_job_mission_control/base.scss +34 -16
- data/app/assets/stylesheets/rocket_job_mission_control/callout.scss +20 -19
- data/app/controllers/rocket_job_mission_control/jobs_controller.rb +5 -5
- data/app/helpers/rocket_job_mission_control/application_helper.rb +1 -1
- data/app/helpers/rocket_job_mission_control/jobs_helper.rb +25 -31
- data/app/views/layouts/rocket_job_mission_control/partials/_header.html.haml +3 -1
- data/app/views/rocket_job_mission_control/jobs/_list.html.haml +11 -13
- data/app/views/rocket_job_mission_control/jobs/_status.html.haml +1 -0
- data/app/views/rocket_job_mission_control/jobs/index.html.haml +2 -1
- data/app/views/rocket_job_mission_control/jobs/show.html.haml +1 -1
- data/lib/rocket_job_mission_control/version.rb +1 -1
- data/lib/rocketjob_mission_control.rb +1 -1
- data/spec/dummy/log/test.log +2268 -0
- data/spec/helpers/jobs_helper_spec.rb +13 -40
- data/spec/rails_helper.rb +2 -2
- data/spec/spec_helper.rb +2 -2
- metadata +6 -18
@@ -1,58 +1,31 @@
|
|
1
1
|
require 'rails_helper'
|
2
2
|
|
3
3
|
module RocketJobMissionControl
|
4
|
-
class ::TheJobClass < OpenStruct;
|
4
|
+
class ::TheJobClass < OpenStruct;
|
5
|
+
end
|
5
6
|
|
6
7
|
RSpec.describe JobsHelper, type: :helper do
|
7
|
-
describe
|
8
|
+
describe '#job_state_icon' do
|
8
9
|
JobsHelper::STATE_ICON_MAP.each do |state, expected_class|
|
9
10
|
context "when the job state is #{state}" do
|
10
|
-
it
|
11
|
-
expect(helper.job_state_icon(state)).to eq(expected_class)
|
11
|
+
it 'returns the correct class' do
|
12
|
+
expect(helper.job_state_icon(state)).to eq("#{expected_class} #{state}")
|
12
13
|
end
|
13
14
|
end
|
14
15
|
end
|
15
|
-
|
16
|
-
context "with an unexpected state" do
|
17
|
-
it "returns the default class" do
|
18
|
-
expect(helper.job_state_icon(:unexpected)).to eq('fa-times danger')
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
describe "#job_class" do
|
24
|
-
let(:job) { double(:job, state: job_state) }
|
25
|
-
|
26
|
-
JobsHelper::STATE_CLASS_MAP.each do |state, expected_class|
|
27
|
-
context "when job state is #{state}" do
|
28
|
-
let(:job_state) { state }
|
29
|
-
|
30
|
-
it "returns the correct class" do
|
31
|
-
expect(helper.job_class(job)).to eq(expected_class)
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
context "with an unexpected state" do
|
37
|
-
let(:job_state) { :unexpected }
|
38
|
-
|
39
|
-
it "returns the default class" do
|
40
|
-
expect(helper.job_class(job)).to eq("")
|
41
|
-
end
|
42
|
-
end
|
43
16
|
end
|
44
17
|
|
45
|
-
describe
|
18
|
+
describe '#pretty_print_array_or_hash' do
|
46
19
|
let(:arguments) { [42, "muad'dib"] }
|
47
20
|
let(:helper_output) { helper.pretty_print_array_or_hash(arguments) }
|
48
21
|
|
49
|
-
context
|
50
|
-
it
|
22
|
+
context 'when arguments is a simple array' do
|
23
|
+
it 'returns a string with spacing and line breaks' do
|
51
24
|
expect(helper_output).to eq("[<br /> 42,<br /> \"muad'dib\"<br />]")
|
52
25
|
end
|
53
26
|
end
|
54
27
|
|
55
|
-
context
|
28
|
+
context 'when arguments is an array with complex data' do
|
56
29
|
let(:arguments) {
|
57
30
|
[
|
58
31
|
42,
|
@@ -63,7 +36,7 @@ module RocketJobMissionControl
|
|
63
36
|
]
|
64
37
|
}
|
65
38
|
|
66
|
-
it
|
39
|
+
it 'returns a string with spacing and line breaks' do
|
67
40
|
expected_output = "[<br /> 42,<br /> {<br /> \"crew\": [<br /> \"leela\",<br /> \"fry\",<br /> \"bender\"<br /> ],<br /> \"created_at\": \"1999-03-28\"<br /> }<br />]"
|
68
41
|
expect(helper_output).to eq(expected_output)
|
69
42
|
end
|
@@ -72,7 +45,7 @@ module RocketJobMissionControl
|
|
72
45
|
context "when arguments isn't an array or hash" do
|
73
46
|
let(:arguments) { 42 }
|
74
47
|
|
75
|
-
it
|
48
|
+
it 'returns the arguments' do
|
76
49
|
expect(helper_output).to eq(arguments)
|
77
50
|
end
|
78
51
|
end
|
@@ -83,7 +56,7 @@ module RocketJobMissionControl
|
|
83
56
|
let(:job) { TheJobClass.new(perform_method: perform_method, priority: 42) }
|
84
57
|
|
85
58
|
context "with a job using the 'perform' perform_method" do
|
86
|
-
it
|
59
|
+
it 'returns the correct string without the perform method' do
|
87
60
|
expect(helper.job_title(job)).to eq('TheJobClass')
|
88
61
|
end
|
89
62
|
end
|
@@ -91,7 +64,7 @@ module RocketJobMissionControl
|
|
91
64
|
context "with a job using a perform method that is not 'perform'" do
|
92
65
|
let(:perform_method) { :bendit }
|
93
66
|
|
94
|
-
it
|
67
|
+
it 'returns the correct string with the perform method' do
|
95
68
|
expect(helper.job_title(job)).to eq("TheJobClass##{perform_method}")
|
96
69
|
end
|
97
70
|
end
|
data/spec/rails_helper.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
2
2
|
ENV['RAILS_ENV'] ||= 'test'
|
3
3
|
require 'spec_helper'
|
4
|
-
require File.expand_path(
|
4
|
+
require File.expand_path('../../spec/dummy/config/environment.rb', __FILE__)
|
5
5
|
|
6
6
|
require 'rspec/rails'
|
7
7
|
# Add additional requires below this line. Rails is not loaded until this point!
|
@@ -23,7 +23,7 @@ require 'rspec/rails'
|
|
23
23
|
|
24
24
|
RSpec.configure do |config|
|
25
25
|
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
|
26
|
-
config.fixture_path
|
26
|
+
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
27
27
|
|
28
28
|
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
29
29
|
# examples within a transaction, remove the following line or assign false
|
data/spec/spec_helper.rb
CHANGED
@@ -34,8 +34,8 @@ RSpec.configure do |config|
|
|
34
34
|
mocks.verify_partial_doubles = true
|
35
35
|
end
|
36
36
|
|
37
|
-
# The settings below are suggested to provide a good initial experience
|
38
|
-
# with RSpec, but feel free to customize to your heart's content.
|
37
|
+
# The settings below are suggested to provide a good initial experience
|
38
|
+
# with RSpec, but feel free to customize to your heart's content.
|
39
39
|
=begin
|
40
40
|
# These two settings work together to allow you to limit a spec run
|
41
41
|
# to individual examples or groups you care about by tagging them with
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rocketjob_mission_control
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Cloutier
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-08-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -81,20 +81,6 @@ dependencies:
|
|
81
81
|
- - ">="
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '3.2'
|
84
|
-
- !ruby/object:Gem::Dependency
|
85
|
-
name: rubyzip
|
86
|
-
requirement: !ruby/object:Gem::Requirement
|
87
|
-
requirements:
|
88
|
-
- - ">="
|
89
|
-
- !ruby/object:Gem::Version
|
90
|
-
version: '0'
|
91
|
-
type: :runtime
|
92
|
-
prerelease: false
|
93
|
-
version_requirements: !ruby/object:Gem::Requirement
|
94
|
-
requirements:
|
95
|
-
- - ">="
|
96
|
-
- !ruby/object:Gem::Version
|
97
|
-
version: '0'
|
98
84
|
- !ruby/object:Gem::Dependency
|
99
85
|
name: rocketjob
|
100
86
|
requirement: !ruby/object:Gem::Requirement
|
@@ -165,7 +151,7 @@ dependencies:
|
|
165
151
|
- - ">="
|
166
152
|
- !ruby/object:Gem::Version
|
167
153
|
version: '0'
|
168
|
-
description:
|
154
|
+
description: Rails Engine for adding the web interface for rocketjob to Rails apps
|
169
155
|
email:
|
170
156
|
- ''
|
171
157
|
executables: []
|
@@ -174,6 +160,8 @@ extra_rdoc_files: []
|
|
174
160
|
files:
|
175
161
|
- MIT-LICENSE
|
176
162
|
- Rakefile
|
163
|
+
- app/assets/images/rocket_job_mission_control/rocket-icon-512x512.png
|
164
|
+
- app/assets/images/rocket_job_mission_control/rocket-icon-64x64.png
|
177
165
|
- app/assets/javascripts/rocket_job_mission_control/application.js
|
178
166
|
- app/assets/javascripts/rocket_job_mission_control/base.js.coffee
|
179
167
|
- app/assets/javascripts/rocket_job_mission_control/jobs.js.coffee
|
@@ -272,7 +260,7 @@ rubyforge_project:
|
|
272
260
|
rubygems_version: 2.4.8
|
273
261
|
signing_key:
|
274
262
|
specification_version: 4
|
275
|
-
summary: Web
|
263
|
+
summary: Mission Control is the Web user interface to manage rocketjob jobs
|
276
264
|
test_files:
|
277
265
|
- spec/controllers/application_controller_spec.rb
|
278
266
|
- spec/controllers/jobs_controller_spec.rb
|