harbinger 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/views/harbinger/messages/index.html.erb +0 -2
- data/lib/harbinger.rb +15 -0
- data/lib/harbinger/reporters/request_reporter.rb +1 -1
- data/lib/harbinger/version.rb +1 -1
- data/spec/lib/harbinger/reporters/request_reporter_spec.rb +0 -1
- data/spec/lib/harbinger_spec.rb +0 -2
- data/spec/routing/harbinger/messages_routing_spec.rb +8 -0
- data/spec/views/harbinger/messages/index.html.erb_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b0bea4c48dcc7229a5fad10890156d7bd4f2eacd
|
4
|
+
data.tar.gz: ca2757f4f3c39c94d1dc2729627f51b9d169026a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2d294197b4351ebb4e5f8cedb0dccd755848b85070415134ad9c9ffce602145e67e92be2fd48069b909ecccdce7b64b43ea3e79b4e3ba29fadd1e40a9098570
|
7
|
+
data.tar.gz: 72e24439e10044ccc947a137b6fc682b598558fc8a81469cad0daa5a175fdd01b4a3b95c5da913d737c0d4fb14f2117ffb3995dca6c6dde82efeb4e5143a91d3
|
data/lib/harbinger.rb
CHANGED
@@ -107,4 +107,19 @@ module Harbinger
|
|
107
107
|
configuration.database_storage
|
108
108
|
end
|
109
109
|
|
110
|
+
|
111
|
+
# As per an isolated_namespace Rails engine.
|
112
|
+
# But the isolated namespace creates issues.
|
113
|
+
# @api private
|
114
|
+
def table_name_prefix
|
115
|
+
'harbinger_'
|
116
|
+
end
|
117
|
+
|
118
|
+
# Because I am not using isolate_namespace for Orcid::Engine
|
119
|
+
# I need this for the application router to find the appropriate routes.
|
120
|
+
# @api private
|
121
|
+
def use_relative_model_naming?
|
122
|
+
true
|
123
|
+
end
|
124
|
+
|
110
125
|
end
|
@@ -5,7 +5,7 @@ module Harbinger
|
|
5
5
|
private :method_names
|
6
6
|
def initialize(request, config = {})
|
7
7
|
@request = request
|
8
|
-
@method_names = config.fetch(:method_names) { ['path', '
|
8
|
+
@method_names = config.fetch(:method_names) { ['path', 'user_agent'] }
|
9
9
|
end
|
10
10
|
|
11
11
|
def accept(message)
|
data/lib/harbinger/version.rb
CHANGED
@@ -15,7 +15,6 @@ module Harbinger::Reporters
|
|
15
15
|
|
16
16
|
When { reporter.accept(message) }
|
17
17
|
Then { expect(message).to have_received(:append).with('request', 'path', request.path) }
|
18
|
-
And { expect(message).to have_received(:append).with('request', 'params', request.params) }
|
19
18
|
And { expect(message).to have_received(:append).with('request', 'user_agent', request.user_agent) }
|
20
19
|
|
21
20
|
end
|
data/spec/lib/harbinger_spec.rb
CHANGED
@@ -18,7 +18,6 @@ describe Harbinger do
|
|
18
18
|
Then do expect(message.attributes).to eq(
|
19
19
|
'user.username' => [user.username],
|
20
20
|
'request.path' => [request.path],
|
21
|
-
'request.params' => [request.params],
|
22
21
|
'request.user_agent' => [request.user_agent]
|
23
22
|
)
|
24
23
|
end
|
@@ -31,7 +30,6 @@ describe Harbinger do
|
|
31
30
|
Then do expect(message.attributes).to eq(
|
32
31
|
'user.username' => [user.username],
|
33
32
|
'request.path' => [request.path],
|
34
|
-
'request.params' => [request.params],
|
35
33
|
'request.user_agent' => [request.user_agent]
|
36
34
|
)
|
37
35
|
end
|
@@ -12,5 +12,13 @@ module Harbinger
|
|
12
12
|
expect(message_path('1')).to eq('/harbinger/messages/1')
|
13
13
|
end
|
14
14
|
|
15
|
+
it 'should route actions based on namespace' do
|
16
|
+
expect(
|
17
|
+
url_for(
|
18
|
+
{ action: "index", controller: "harbinger/messages", page: nil, only_path: true }
|
19
|
+
)
|
20
|
+
).to eq('/harbinger/messages')
|
21
|
+
end
|
22
|
+
|
15
23
|
end
|
16
24
|
end
|
@@ -16,7 +16,7 @@ describe 'harbinger/messages/index.html.erb', type: :view do
|
|
16
16
|
end
|
17
17
|
let(:harbinger) { double("Engine", message_path: true, messages_path: '/messages/') }
|
18
18
|
it 'renders the object and fieldsets' do
|
19
|
-
expect(view).
|
19
|
+
expect(view).to_not receive(:paginate).with([message])
|
20
20
|
expect(harbinger).to receive(:message_path).with(message.to_param).and_return("/messages/#{message.to_param}")
|
21
21
|
render template: "harbinger/messages/index.html.erb", locals: { messages: [message], harbinger: harbinger }
|
22
22
|
expect(rendered).to have_tag('.search-form') do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: harbinger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Friesen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: kaminari
|