bumbleworks-rails 0.0.6 → 0.0.7
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.
- checksums.yaml +4 -4
- data/app/controllers/bumbleworks/rails/tasks_controller.rb +2 -2
- data/app/helpers/bumbleworks/rails/tasks_helper.rb +12 -0
- data/app/views/bumbleworks/rails/tasks/_table.html.erb +2 -2
- data/app/views/bumbleworks/rails/tasks/index.html.erb +2 -2
- data/lib/bumbleworks/rails/version.rb +1 -1
- data/spec/controllers/tasks_controller_spec.rb +14 -17
- data/spec/dummy/log/development.log +287 -0
- data/spec/dummy/log/test.log +1469 -0
- data/spec/helpers/tasks_helper_spec.rb +46 -1
- metadata +2 -2
@@ -3,7 +3,8 @@ describe Bumbleworks::Rails::TasksHelper do
|
|
3
3
|
double(Bumbleworks::Task, {
|
4
4
|
:nickname => 'chew_on_quandary',
|
5
5
|
:entity => Fridget.new(5),
|
6
|
-
:has_entity? => true
|
6
|
+
:has_entity? => true,
|
7
|
+
:id => '12345-spaghetti-hats'
|
7
8
|
})
|
8
9
|
}
|
9
10
|
|
@@ -51,4 +52,48 @@ describe Bumbleworks::Rails::TasksHelper do
|
|
51
52
|
expect(helper.render_task_partial(task)).to eq('pretend')
|
52
53
|
end
|
53
54
|
end
|
55
|
+
|
56
|
+
context 'task url helpers' do
|
57
|
+
let(:main_app) { double('main_app') }
|
58
|
+
|
59
|
+
before(:each) do
|
60
|
+
allow(helper).to receive(:main_app).and_return(main_app)
|
61
|
+
end
|
62
|
+
|
63
|
+
describe '#entity_task_url' do
|
64
|
+
it 'returns an entity-specific url for the task' do
|
65
|
+
allow(main_app).to receive(:task_url).
|
66
|
+
with(:entity_type => 'fridgets', :entity_id => 5, :other => :things, :id => task.id).
|
67
|
+
and_return(:the_url)
|
68
|
+
expect(helper.entity_task_url(task, :other => :things)).to eq(:the_url)
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
describe '#entity_tasks_url' do
|
73
|
+
it 'returns an entity-specific task index' do
|
74
|
+
allow(main_app).to receive(:tasks_url).
|
75
|
+
with(:entity_type => 'fridgets', :entity_id => 5, :other => :things).
|
76
|
+
and_return(:the_url)
|
77
|
+
expect(helper.entity_tasks_url(task.entity, :other => :things)).to eq(:the_url)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
describe '#entity_task_path' do
|
82
|
+
it 'returns a path-only entity task url' do
|
83
|
+
allow(helper).to receive(:entity_task_url).
|
84
|
+
with(task.entity, :other => :things, :only_path => true).
|
85
|
+
and_return(:the_url)
|
86
|
+
expect(helper.entity_task_path(task.entity, :other => :things)).to eq(:the_url)
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
describe '#entity_tasks_path' do
|
91
|
+
it 'returns a path-only entity tasks url' do
|
92
|
+
allow(helper).to receive(:entity_tasks_url).
|
93
|
+
with(task.entity, :other => :things, :only_path => true).
|
94
|
+
and_return(:the_url)
|
95
|
+
expect(helper.entity_tasks_path(task.entity, :other => :things)).to eq(:the_url)
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
54
99
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bumbleworks-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ravi Gadad
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|