rearview 1.0.3.rc.1-jruby → 1.0.3.rc.2-jruby
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rearview/url_helper.rb +10 -1
- data/lib/rearview/version.rb +1 -1
- data/spec/dummy/log/development.log +18 -0
- data/spec/dummy/log/test.log +3293 -0
- data/spec/lib/rearview/alerts/campfire_alert_spec.rb +3 -10
- data/spec/lib/rearview/url_helper_spec.rb +25 -4
- metadata +2 -2
@@ -6,20 +6,13 @@ describe Rearview::Alerts::CampfireAlert do
|
|
6
6
|
|
7
7
|
context "alert" do
|
8
8
|
context "valid key" do
|
9
|
-
let(:job) {
|
10
|
-
let(:params) { { "room" => "nyan" } }
|
11
|
-
|
12
|
-
before(:each ) do
|
13
|
-
Rearview::Alerts::CampfireAlert.expects(:params).with("alert_key").returns(params)
|
14
|
-
Rearview::Alerts::CampfireAlert.expects(:key?).returns(true)
|
15
|
-
Broach.expects(:settings=).with(params)
|
16
|
-
end
|
9
|
+
let(:job) { FactoryGirl.create(:job, alert_keys: ["campfire://mycompany.com?token=abc&room=myroom"]) }
|
17
10
|
|
18
11
|
context "with provided error message" do
|
19
12
|
let(:result) { { message: "alert alert!"} }
|
20
13
|
|
21
14
|
it "notifies campfire" do
|
22
|
-
Broach.expects(:speak).with("
|
15
|
+
Broach.expects(:speak).with("myroom", "alert alert! #{Rearview::UrlHelper.job_url(job)}")
|
23
16
|
campfire_alert.alert(job, result)
|
24
17
|
end
|
25
18
|
end
|
@@ -28,7 +21,7 @@ describe Rearview::Alerts::CampfireAlert do
|
|
28
21
|
let(:result) { { } }
|
29
22
|
|
30
23
|
it "notifies campfire" do
|
31
|
-
Broach.expects(:speak).with("
|
24
|
+
Broach.expects(:speak).with("myroom", "Job did not provide an error description #{Rearview::UrlHelper.job_url(job)}")
|
32
25
|
campfire_alert.alert(job, result)
|
33
26
|
end
|
34
27
|
end
|
@@ -1,11 +1,32 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Rearview::UrlHelper do
|
4
|
-
let(:job) { stub(app_id: 1234, id: 42) }
|
5
4
|
subject { Rearview::UrlHelper }
|
6
|
-
context ".
|
7
|
-
|
8
|
-
|
5
|
+
context ".job_url" do
|
6
|
+
context "job in dashboard with parent" do
|
7
|
+
it "generates the correct url" do
|
8
|
+
dashboard_child = FactoryGirl.create(:dashboard,parent: FactoryGirl.create(:dashboard))
|
9
|
+
job = FactoryGirl.create(:job,app_id: dashboard_child.id)
|
10
|
+
expected_url = "http://%s:%s/rearview/#dash/%s/expand/%s" % [
|
11
|
+
Rearview.config.default_url_options[:host],
|
12
|
+
Rearview.config.default_url_options[:port],
|
13
|
+
dashboard_child.parent_id,
|
14
|
+
job.id
|
15
|
+
]
|
16
|
+
expect(subject.job_url(job)).to eq(expected_url)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
context "job in dashboard without parent" do
|
20
|
+
it "generates the correct url" do
|
21
|
+
job = FactoryGirl.create(:job)
|
22
|
+
expected_url = "http://%s:%s/rearview/#dash/%s/expand/%s" % [
|
23
|
+
Rearview.config.default_url_options[:host],
|
24
|
+
Rearview.config.default_url_options[:port],
|
25
|
+
job.app_id,
|
26
|
+
job.id
|
27
|
+
]
|
28
|
+
expect(subject.job_url(job)).to eq(expected_url)
|
29
|
+
end
|
9
30
|
end
|
10
31
|
end
|
11
32
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rearview
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.3.rc.
|
4
|
+
version: 1.0.3.rc.2
|
5
5
|
platform: jruby
|
6
6
|
authors:
|
7
7
|
- Trent Albright
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-01-
|
11
|
+
date: 2014-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|