-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathpage_spec.rb
More file actions
47 lines (32 loc) · 1.04 KB
/
page_spec.rb
File metadata and controls
47 lines (32 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
require_relative "spec_helper"
describe Page do
before(:each) do
Page.delete_all
end
it "should know it's at the end of the road" do
page = Page.create(conclusion: true)
page.conclusion?.should be_true
end
it "should have awesome content" do
page = Page.create(content: "The fox and hound get along")
Page.find(page.id).content.should eq("The fox and hound get along")
end
context "#options" do
let(:option_a) {Page.create(preview: "Option_a view") }
let(:option_b) {Page.create(preview: "Option_b view") }
subject {Page.create(option_a_id: option_a.id, option_b_id: option_b.id)}
it "should have options for the next pages" do
subject.options.should eq([option_a, option_b])
end
end
it "should have a starting point by default" do
Page.create.starting_point.should eq(false)
end
it "should not be a conclusion by default" do
Page.create.conclusion.should eq(false)
end
it "should have a starting point" do
the_page = Page.create(starting_point: true)
Page.starting_point.should eq(the_page)
end
end