bit_core 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,19 +4,6 @@ module BitCore
4
4
  describe Slide do
5
5
  fixtures :"bit_core/slideshows", :"bit_core/slides"
6
6
 
7
- describe ".update_positions" do
8
- it "should update slide positions to match the order of the ids" do
9
- slide1 = bit_core_slides(:slide1)
10
- slide2 = bit_core_slides(:slide2)
11
- slide3 = bit_core_slides(:slide3)
12
- BitCore::Slide.update_positions([slide3.id, slide1.id, slide2.id])
13
-
14
- expect(BitCore::Slide.find(slide1.id).position).to eq(2)
15
- expect(BitCore::Slide.find(slide2.id).position).to eq(3)
16
- expect(BitCore::Slide.find(slide3.id).position).to eq(1)
17
- end
18
- end
19
-
20
7
  describe "#render_body" do
21
8
  it "should render a nil body" do
22
9
  expect(subject.render_body).to eq("")
@@ -0,0 +1,44 @@
1
+ require "spec_helper"
2
+
3
+ module BitCore
4
+ describe Slideshow do
5
+ fixtures :"bit_core/slideshows", :"bit_core/slides"
6
+
7
+ let(:slideshow) { bit_core_slideshows(:slideshow1) }
8
+
9
+ describe "#add" do
10
+ it "should return a slide with its position set to the end" do
11
+ new_slide = slideshow.add(title: "New", body: "Slide")
12
+
13
+ expect(new_slide.valid?).to be_truthy
14
+ expect(new_slide.position).to eq 4
15
+ end
16
+ end
17
+
18
+ describe "#remove" do
19
+ it "should update remaining slide positions" do
20
+ result = slideshow.remove(bit_core_slides(:slide2))
21
+
22
+ expect(result).to be_truthy
23
+ expect(slideshow.slides.count).to eq 2
24
+ expect(slideshow.slides.first.id).to eq bit_core_slides(:slide1).id
25
+ expect(slideshow.slides.first.position).to eq 1
26
+ expect(slideshow.slides.second.id).to eq bit_core_slides(:slide3).id
27
+ expect(slideshow.slides.second.position).to eq 2
28
+ end
29
+ end
30
+
31
+ describe "#sort" do
32
+ it "should update slide positions to match the order of the ids" do
33
+ slide1 = bit_core_slides(:slide1)
34
+ slide2 = bit_core_slides(:slide2)
35
+ slide3 = bit_core_slides(:slide3)
36
+ slideshow.sort([slide3.id, slide1.id, slide2.id])
37
+
38
+ expect(slideshow.slides.find(slide1.id).position).to eq(2)
39
+ expect(slideshow.slides.find(slide2.id).position).to eq(3)
40
+ expect(slideshow.slides.find(slide3.id).position).to eq(1)
41
+ end
42
+ end
43
+ end
44
+ 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.0.0
4
+ version: 1.1.0
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-04-24 00:00:00.000000000 Z
11
+ date: 2014-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 3.0.0.beta
75
+ version: 3.0.1
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 3.0.0.beta
82
+ version: 3.0.1
83
83
  description: Models, migrations, etc.
84
84
  email:
85
85
  - ericcf@northwestern.edu
@@ -150,6 +150,7 @@ files:
150
150
  - spec/fixtures/bit_core/slideshows.yml
151
151
  - spec/fixtures/bit_core/tools.yml
152
152
  - spec/models/bit_core/slide_spec.rb
153
+ - spec/models/bit_core/slideshow_spec.rb
153
154
  - spec/spec_helper.rb
154
155
  homepage: https://github.com/nupmmarkbegale/bit_core
155
156
  licenses:
@@ -217,4 +218,5 @@ test_files:
217
218
  - spec/fixtures/bit_core/slideshows.yml
218
219
  - spec/fixtures/bit_core/tools.yml
219
220
  - spec/models/bit_core/slide_spec.rb
221
+ - spec/models/bit_core/slideshow_spec.rb
220
222
  - spec/spec_helper.rb