bit_core 1.2.2 → 1.4.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,6 @@
1
+ arm1:
2
+ title: Arm 1
3
+ is_social: true
4
+
5
+ arm2:
6
+ title: Arm 2
@@ -1,2 +1,3 @@
1
1
  slideshow1:
2
2
  title: Slideshow 1
3
+ arm: arm1
@@ -1,2 +1,3 @@
1
1
  home:
2
2
  title: Home
3
+ arm: arm1
@@ -0,0 +1,14 @@
1
+ require "spec_helper"
2
+
3
+ module BitCore
4
+ module ContentProviders
5
+ describe SlideshowProvider do
6
+ subject(:provider) { SlideshowProvider.new }
7
+
8
+ it "returns new objects when there is no source content" do
9
+ expect(provider.slideshow).to be_a Slideshow
10
+ expect(provider.slide(1)).to be_a Slide
11
+ end
12
+ end
13
+ end
14
+ end
@@ -21,5 +21,20 @@ module BitCore
21
21
  expect(subject.render_body).to match(/<p>my content<\/p>/)
22
22
  end
23
23
  end
24
+
25
+ describe "when destroyed" do
26
+ let(:slideshow) { bit_core_slideshows(:slideshow1) }
27
+ let(:slide) { bit_core_slides(:slide2) }
28
+
29
+ it "updates the positions of remaining slides" do
30
+ expect(slideshow.slides.map(&:position)).to eq [1, 2, 3]
31
+ expect(slide.position).to eq 2
32
+
33
+ slide.destroy
34
+
35
+ expect(slideshow.reload.slides.map(&:position))
36
+ .to eq [1, 2]
37
+ end
38
+ end
24
39
  end
25
40
  end
@@ -40,5 +40,17 @@ module BitCore
40
40
  expect(slideshow.slides.find(slide3.id).position).to eq(1)
41
41
  end
42
42
  end
43
+
44
+ describe "when a slideshow has many slides" do
45
+ before do
46
+ expect(slideshow.slides.count).to be > 0
47
+ end
48
+
49
+ it "can be deleted" do
50
+ expect do
51
+ slideshow.destroy
52
+ end.to change { BitCore::Slideshow.count }.by(-1)
53
+ end
54
+ end
43
55
  end
44
56
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bit_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Carty-Fickes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-25 00:00:00.000000000 Z
11
+ date: 2016-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -92,6 +92,7 @@ files:
92
92
  - Rakefile
93
93
  - app/assets/stylesheets/bit_core/application.css
94
94
  - app/controllers/bit_core/application_controller.rb
95
+ - app/models/bit_core/audio_slide.rb
95
96
  - app/models/bit_core/content_module.rb
96
97
  - app/models/bit_core/content_provider.rb
97
98
  - app/models/bit_core/content_providers/null.rb
@@ -111,6 +112,12 @@ files:
111
112
  - db/migrate/20140620174146_add_options_to_slides.rb
112
113
  - db/migrate/20140620174147_add_config_fields_to_providers.rb
113
114
  - db/migrate/20140625133118_add_type_to_content_modules.rb
115
+ - db/migrate/20141205202720_create_bit_core_arms.rb
116
+ - db/migrate/20141205202724_add_arm_id_to_bit_core_slideshows.rb
117
+ - db/migrate/20141205202740_add_arm_id_to_bit_core_tools.rb
118
+ - db/migrate/20150130155627_add_type_to_tools.rb
119
+ - db/migrate/20150131195914_add_is_viz_to_content_modules.rb
120
+ - db/migrate/20150210161229_add_tool_constraint.rb
114
121
  - lib/bit_core.rb
115
122
  - lib/bit_core/engine.rb
116
123
  - lib/bit_core/version.rb
@@ -143,13 +150,13 @@ files:
143
150
  - spec/dummy/config/locales/en.yml
144
151
  - spec/dummy/config/routes.rb
145
152
  - spec/dummy/config/secrets.yml
146
- - spec/dummy/db/schema.rb
147
153
  - spec/dummy/log/development.log
148
154
  - spec/dummy/log/test.log
149
155
  - spec/dummy/public/404.html
150
156
  - spec/dummy/public/422.html
151
157
  - spec/dummy/public/500.html
152
158
  - spec/dummy/public/favicon.ico
159
+ - spec/fixtures/arms.yml
153
160
  - spec/fixtures/bit_core/content_modules.yml
154
161
  - spec/fixtures/bit_core/content_providers.yml
155
162
  - spec/fixtures/bit_core/slides.yml
@@ -157,6 +164,7 @@ files:
157
164
  - spec/fixtures/bit_core/tools.yml
158
165
  - spec/models/bit_core/content_module_spec.rb
159
166
  - spec/models/bit_core/content_provider_spec.rb
167
+ - spec/models/bit_core/content_providers/slideshow_provider_spec.rb
160
168
  - spec/models/bit_core/slide_spec.rb
161
169
  - spec/models/bit_core/slideshow_spec.rb
162
170
  - spec/spec_helper.rb
@@ -180,7 +188,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
180
188
  version: '0'
181
189
  requirements: []
182
190
  rubyforge_project:
183
- rubygems_version: 2.2.2
191
+ rubygems_version: 2.4.6
184
192
  signing_key:
185
193
  specification_version: 4
186
194
  summary: Shared models and business logic for bit apps.
@@ -211,7 +219,6 @@ test_files:
211
219
  - spec/dummy/config/routes.rb
212
220
  - spec/dummy/config/secrets.yml
213
221
  - spec/dummy/config.ru
214
- - spec/dummy/db/schema.rb
215
222
  - spec/dummy/log/development.log
216
223
  - spec/dummy/log/test.log
217
224
  - spec/dummy/public/404.html
@@ -220,6 +227,7 @@ test_files:
220
227
  - spec/dummy/public/favicon.ico
221
228
  - spec/dummy/Rakefile
222
229
  - spec/dummy/README.rdoc
230
+ - spec/fixtures/arms.yml
223
231
  - spec/fixtures/bit_core/content_modules.yml
224
232
  - spec/fixtures/bit_core/content_providers.yml
225
233
  - spec/fixtures/bit_core/slides.yml
@@ -227,6 +235,7 @@ test_files:
227
235
  - spec/fixtures/bit_core/tools.yml
228
236
  - spec/models/bit_core/content_module_spec.rb
229
237
  - spec/models/bit_core/content_provider_spec.rb
238
+ - spec/models/bit_core/content_providers/slideshow_provider_spec.rb
230
239
  - spec/models/bit_core/slide_spec.rb
231
240
  - spec/models/bit_core/slideshow_spec.rb
232
241
  - spec/spec_helper.rb
@@ -1,76 +0,0 @@
1
- # encoding: UTF-8
2
- # This file is auto-generated from the current state of the database. Instead
3
- # of editing this file, please use the migrations feature of Active Record to
4
- # incrementally modify your database, and then regenerate this schema definition.
5
- #
6
- # Note that this schema.rb definition is the authoritative source for your
7
- # database schema. If you need to create the application database on another
8
- # system, you should be using db:schema:load, not running all the migrations
9
- # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
- # you'll amass, the slower it'll run and the greater likelihood for issues).
11
- #
12
- # It's strongly recommended that you check this file into your version control system.
13
-
14
- ActiveRecord::Schema.define(version: 20140625133118) do
15
-
16
- # These are extensions that must be enabled in order to support this database
17
- enable_extension "plpgsql"
18
-
19
- create_table "bit_core_content_modules", force: true do |t|
20
- t.string "title", null: false
21
- t.integer "position", default: 1, null: false
22
- t.integer "bit_core_tool_id", null: false
23
- t.datetime "created_at"
24
- t.datetime "updated_at"
25
- t.string "type"
26
- end
27
-
28
- add_index "bit_core_content_modules", ["bit_core_tool_id", "position"], name: "bit_core_content_module_position", unique: true, using: :btree
29
-
30
- create_table "bit_core_content_providers", force: true do |t|
31
- t.string "type", null: false
32
- t.string "source_content_type"
33
- t.integer "source_content_id"
34
- t.integer "bit_core_content_module_id", null: false
35
- t.integer "position", default: 1, null: false
36
- t.datetime "created_at"
37
- t.datetime "updated_at"
38
- t.string "template_path"
39
- t.string "data_class_name"
40
- t.text "data_attributes"
41
- t.boolean "show_next_nav"
42
- t.text "locals"
43
- end
44
-
45
- add_index "bit_core_content_providers", ["bit_core_content_module_id", "position"], name: "bit_core_content_provider_position", unique: true, using: :btree
46
-
47
- create_table "bit_core_slides", force: true do |t|
48
- t.string "title", null: false
49
- t.text "body", null: false
50
- t.integer "position", default: 1, null: false
51
- t.integer "bit_core_slideshow_id", null: false
52
- t.string "type"
53
- t.boolean "is_title_visible", default: true, null: false
54
- t.datetime "created_at"
55
- t.datetime "updated_at"
56
- t.text "options"
57
- end
58
-
59
- add_index "bit_core_slides", ["bit_core_slideshow_id", "position"], name: "bit_core_slide_position", unique: true, using: :btree
60
-
61
- create_table "bit_core_slideshows", force: true do |t|
62
- t.string "title", null: false
63
- t.datetime "created_at"
64
- t.datetime "updated_at"
65
- end
66
-
67
- create_table "bit_core_tools", force: true do |t|
68
- t.string "title", null: false
69
- t.integer "position", default: 0, null: false
70
- t.datetime "created_at"
71
- t.datetime "updated_at"
72
- end
73
-
74
- add_index "bit_core_tools", ["position"], name: "bit_core_tool_position", unique: true, using: :btree
75
-
76
- end