semi_static 0.7.0 → 0.7.1
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/CHANGELOG.md +5 -0
- data/lib/semi_static/controller/page.rb +1 -1
- data/lib/semi_static/version.rb +1 -1
- data/semi_static.gemspec +1 -1
- data/spec/backend_spec.rb +4 -4
- data/spec/{acceptance → features}/acceptance_helper.rb +0 -0
- data/spec/{acceptance → features}/custom_controllers_spec.rb +4 -4
- data/spec/{acceptance → features}/fake/app.rb +0 -0
- data/spec/{acceptance → features}/fake/app/controllers/admin/faqs_controller.rb +1 -1
- data/spec/{acceptance → features}/fake/app/controllers/faqs_controller.rb +0 -0
- data/spec/{acceptance → features}/fake/app/models/event_planning_tip.rb +0 -0
- data/spec/{acceptance → features}/fake/app/models/faq.rb +0 -0
- data/spec/{acceptance → features}/fake/app/models/news.rb +0 -0
- data/spec/{acceptance → features}/fake/app/views/application.html.erb +0 -0
- data/spec/{acceptance → features}/fake/semi_static_pages/event_planning_tips/erb_chained.md.erb +0 -0
- data/spec/{acceptance → features}/fake/semi_static_pages/event_planning_tips/erb_page.erb +0 -0
- data/spec/{acceptance → features}/fake/semi_static_pages/event_planning_tips/manner.md +0 -0
- data/spec/{acceptance → features}/fake/semi_static_pages/event_planning_tips/multibyte-bang.md +0 -0
- data/spec/{acceptance → features}/fake/semi_static_pages/event_planning_tips/non_standard_slug.md +0 -0
- data/spec/{acceptance → features}/fake/semi_static_pages/faqs/checkin_devices.md +0 -0
- data/spec/{acceptance → features}/fake/semi_static_pages/news/2011-07-26-replaced-download.md +0 -0
- data/spec/features/news_spec.rb +23 -0
- data/spec/features/page_spec.rb +49 -0
- data/spec/news_spec.rb +3 -3
- data/spec/page_spec.rb +9 -9
- metadata +44 -43
- data/spec/acceptance/news_spec.rb +0 -23
- data/spec/acceptance/page_spec.rb +0 -49
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3858969d960851aac2a526e58a77c5ea8bf60e90
|
|
4
|
+
data.tar.gz: 91ea7acfd26f2b652aff02c3cdd3b7fc0521ff38
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bbbbf86c4132f478f63ea3022de271eade1d5f0fdee99f462906269e2b8387485b86b4259dc11a4bc46525a063cfec1b879b2fad556352f0973b172651ca7bbe
|
|
7
|
+
data.tar.gz: 4facbede2541763b876aec97d9e06cb83a4b877969983763e89664ffaaa8373eed04171e4fb70c537adee14c3a0ec8e1e6a2162682908446dfbd595b6449c2d8
|
data/CHANGELOG.md
ADDED
data/lib/semi_static/version.rb
CHANGED
data/semi_static.gemspec
CHANGED
|
@@ -23,6 +23,6 @@ Gem::Specification.new do |s|
|
|
|
23
23
|
s.add_dependency 'babosa'
|
|
24
24
|
s.add_dependency 'tilt', '>= 1.3.4'
|
|
25
25
|
|
|
26
|
-
s.add_development_dependency 'rspec-rails', '
|
|
26
|
+
s.add_development_dependency 'rspec-rails', '>= 3.0'
|
|
27
27
|
s.add_development_dependency 'capybara', '~> 2.1'
|
|
28
28
|
end
|
data/spec/backend_spec.rb
CHANGED
|
@@ -12,15 +12,15 @@ describe SemiStatic::Backend do
|
|
|
12
12
|
|
|
13
13
|
context "all" do
|
|
14
14
|
before { @all = @backend.all(News) }
|
|
15
|
-
it { @all.size.
|
|
15
|
+
it { expect(@all.size).to eq(1) }
|
|
16
16
|
|
|
17
17
|
context "item" do
|
|
18
18
|
before { @item = @all.first }
|
|
19
|
-
it { @item.title.
|
|
20
|
-
it { @item.published_at.
|
|
19
|
+
it { expect(@item.title).to eq("請求書のダウンロードが可能になりました") }
|
|
20
|
+
it { expect(@item.published_at).to eq(Date.parse("2011-07-26")) }
|
|
21
21
|
context "body" do
|
|
22
22
|
subject { @item.body.render(self) }
|
|
23
|
-
it {
|
|
23
|
+
it { is_expected.to include("<br>") }
|
|
24
24
|
end
|
|
25
25
|
end
|
|
26
26
|
end
|
|
File without changes
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
# encoding: UTF-8
|
|
2
2
|
require File.expand_path(File.dirname(__FILE__) + '/acceptance_helper')
|
|
3
3
|
|
|
4
|
-
feature 'custom controllers' do
|
|
4
|
+
feature 'custom controllers', type: :feature do
|
|
5
5
|
scenario "index" do
|
|
6
6
|
visit faqs_path
|
|
7
|
-
find("h1 a").text.
|
|
7
|
+
expect(find("h1 a").text).to eq("チェックイン端末とはなんですか?")
|
|
8
8
|
end
|
|
9
9
|
|
|
10
10
|
scenario "overwritten method" do
|
|
11
11
|
visit faq_path(:id => "管理端末とはなんですか?")
|
|
12
|
-
find("h1").text.
|
|
12
|
+
expect(find("h1").text).to eq("チェックイン端末とはなんですか?")
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
scenario "namespaced controller" do
|
|
16
16
|
visit admin_faqs_path
|
|
17
|
-
find("body").text.
|
|
17
|
+
expect(find("body").text).to eq("Namespaced")
|
|
18
18
|
end
|
|
19
19
|
end
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/spec/{acceptance → features}/fake/semi_static_pages/event_planning_tips/erb_chained.md.erb
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/spec/{acceptance → features}/fake/semi_static_pages/event_planning_tips/multibyte-bang.md
RENAMED
|
File without changes
|
data/spec/{acceptance → features}/fake/semi_static_pages/event_planning_tips/non_standard_slug.md
RENAMED
|
File without changes
|
|
File without changes
|
data/spec/{acceptance → features}/fake/semi_static_pages/news/2011-07-26-replaced-download.md
RENAMED
|
File without changes
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# encoding: UTF-8
|
|
2
|
+
require File.expand_path(File.dirname(__FILE__) + '/acceptance_helper')
|
|
3
|
+
|
|
4
|
+
feature 'news', type: :feature do
|
|
5
|
+
scenario "index" do
|
|
6
|
+
visit news_index_path
|
|
7
|
+
expect(page.find("h1 a").text).to eq("請求書のダウンロードが可能になりました")
|
|
8
|
+
expect(page.find("date").text).to eq("July 26, 2011")
|
|
9
|
+
expect(page.find("p").text).to eq("各請求書のページに「ダウンロード」ボタンを設置し、作成した請求書をPDFファイルとしてダウンロードできるようになりました。")
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
scenario 'show markdown page' do
|
|
13
|
+
visit "/news/2011/7/26/#{CGI.escape("請求書のダウンロードが可能になりました")}"
|
|
14
|
+
expect(page.find("h1").text).to eq("請求書のダウンロードが可能になりました")
|
|
15
|
+
expect(page.find("date").text).to eq("July 26, 2011")
|
|
16
|
+
expect(page.find("p").text).to eq("各請求書のページに「ダウンロード」ボタンを設置し、作成した請求書をPDFファイルとしてダウンロードできるようになりました。")
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
scenario 'show non-existant page' do
|
|
20
|
+
visit "/news/1999/1/23/foo"
|
|
21
|
+
expect(page.status_code).to eq(404)
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# encoding: UTF-8
|
|
2
|
+
require File.expand_path(File.dirname(__FILE__) + '/acceptance_helper')
|
|
3
|
+
|
|
4
|
+
feature 'page', type: :feature do
|
|
5
|
+
scenario "index" do
|
|
6
|
+
visit '/event_planning_tips'
|
|
7
|
+
expect(page).to have_css("h1 a")
|
|
8
|
+
expect(page).to have_content("イベント時に気をつけたいマナー")
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
scenario 'show markdown page' do
|
|
12
|
+
visit "/event_planning_tips/#{CGI.escape("イベント時に気をつけたいマナー")}"
|
|
13
|
+
expect(page.find("h1").text).to eq("イベント時に気をつけたいマナー")
|
|
14
|
+
expect(page.find("section h2").text).to eq("1. 無断に写真や動画の撮影、公開しない")
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
scenario 'show multibyte bang' do
|
|
18
|
+
visit "/event_planning_tips/#{CGI.escape("イベントやろう")}"
|
|
19
|
+
expect(current_path).to eq("/event_planning_tips/#{CGI.escape("イベントやろう")}")
|
|
20
|
+
expect(page.find("h1").text).to eq("イベントやろう!")
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
scenario 'show erb page' do
|
|
24
|
+
visit "/event_planning_tips/erb-test"
|
|
25
|
+
expect(page.find(".erb").text).to eq("1 + 1 = 2")
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
scenario 'show erb chained' do
|
|
29
|
+
visit "/event_planning_tips/erb-chained"
|
|
30
|
+
expect(page.find("h2").text).to eq("1 + 1 = 2")
|
|
31
|
+
expect(page).to have_css "img"
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
scenario 'non standard slug' do
|
|
35
|
+
visit "/event_planning_tips/non-standard-slug"
|
|
36
|
+
expect(page.find("h1").text).to eq("Title is different than slug")
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
scenario 'slug is not validly encoded' do
|
|
40
|
+
visit "/event_planning_tips/%8e%8f"
|
|
41
|
+
expect(page.status_code).to eq(400)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
scenario 'redirect in case of double escape' do
|
|
45
|
+
visit "/event_planning_tips/#{CGI.escape(CGI.escape("イベントやろう"))}"
|
|
46
|
+
expect(current_path).to eq("/event_planning_tips/#{CGI.escape("イベントやろう")}")
|
|
47
|
+
expect(page.find("h1").text).to eq("イベントやろう!")
|
|
48
|
+
end
|
|
49
|
+
end
|
data/spec/news_spec.rb
CHANGED
|
@@ -4,9 +4,9 @@ require 'spec_helper'
|
|
|
4
4
|
describe SemiStatic::News do
|
|
5
5
|
before do
|
|
6
6
|
@page = described_class.new("body", :title => "ほげ", :published_at => Date.parse("2001-01-31"))
|
|
7
|
-
SemiStatic.backend =
|
|
7
|
+
SemiStatic.backend = double(:all => [ @page ])
|
|
8
8
|
end
|
|
9
9
|
|
|
10
|
-
it { @page.to_param.
|
|
11
|
-
it { News.find("2001/1/31/ほげ").
|
|
10
|
+
it { expect(@page.to_param).to eq("2001/1/31/ほげ") }
|
|
11
|
+
it { expect(SemiStatic::News.find("2001/1/31/ほげ")).to eq(@page) }
|
|
12
12
|
end
|
data/spec/page_spec.rb
CHANGED
|
@@ -5,15 +5,15 @@ describe SemiStatic::Page do
|
|
|
5
5
|
before do
|
|
6
6
|
@japanese_page = described_class.new("body", :title => "ほげ")
|
|
7
7
|
@english_page = described_class.new("body", :title => "foo bar")
|
|
8
|
-
SemiStatic.backend =
|
|
8
|
+
SemiStatic.backend = double(:all => [ @japanese_page, @english_page ])
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
it { @japanese_page.to_param.
|
|
12
|
-
it { @japanese_page.to_s.
|
|
13
|
-
it { @english_page.to_param.
|
|
14
|
-
it { @english_page.to_s.
|
|
15
|
-
it { described_class.new(nil, {}).to_s.
|
|
16
|
-
it { SemiStatic::Page.find("foo-bar").
|
|
17
|
-
it { SemiStatic::Page.find("ほげ").
|
|
18
|
-
it { SemiStatic::Page.find(CGI.escape("ほげ")).
|
|
11
|
+
it { expect(@japanese_page.to_param).to eq("ほげ") }
|
|
12
|
+
it { expect(@japanese_page.to_s).to eq("ほげ") }
|
|
13
|
+
it { expect(@english_page.to_param).to eq("foo-bar") }
|
|
14
|
+
it { expect(@english_page.to_s).to eq("foo bar") }
|
|
15
|
+
it { expect(described_class.new(nil, {}).to_s).to eq("") }
|
|
16
|
+
it { expect(SemiStatic::Page.find("foo-bar")).to eq(@english_page) }
|
|
17
|
+
it { expect(SemiStatic::Page.find("ほげ")).to eq(@japanese_page) }
|
|
18
|
+
it { expect(SemiStatic::Page.find(CGI.escape("ほげ"))).to eq(@japanese_page) }
|
|
19
19
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: semi_static
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.7.
|
|
4
|
+
version: 0.7.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Paul McMahon
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2017-05-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|
|
@@ -70,16 +70,16 @@ dependencies:
|
|
|
70
70
|
name: rspec-rails
|
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
|
72
72
|
requirements:
|
|
73
|
-
- - "
|
|
73
|
+
- - ">="
|
|
74
74
|
- !ruby/object:Gem::Version
|
|
75
|
-
version: '
|
|
75
|
+
version: '3.0'
|
|
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: '
|
|
82
|
+
version: '3.0'
|
|
83
83
|
- !ruby/object:Gem::Dependency
|
|
84
84
|
name: capybara
|
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -102,6 +102,7 @@ extensions: []
|
|
|
102
102
|
extra_rdoc_files: []
|
|
103
103
|
files:
|
|
104
104
|
- ".gitignore"
|
|
105
|
+
- CHANGELOG.md
|
|
105
106
|
- Gemfile
|
|
106
107
|
- README.md
|
|
107
108
|
- Rakefile
|
|
@@ -125,25 +126,25 @@ files:
|
|
|
125
126
|
- lib/semi_static/tilt_wrapper.rb
|
|
126
127
|
- lib/semi_static/version.rb
|
|
127
128
|
- semi_static.gemspec
|
|
128
|
-
- spec/acceptance/acceptance_helper.rb
|
|
129
|
-
- spec/acceptance/custom_controllers_spec.rb
|
|
130
|
-
- spec/acceptance/fake/app.rb
|
|
131
|
-
- spec/acceptance/fake/app/controllers/admin/faqs_controller.rb
|
|
132
|
-
- spec/acceptance/fake/app/controllers/faqs_controller.rb
|
|
133
|
-
- spec/acceptance/fake/app/models/event_planning_tip.rb
|
|
134
|
-
- spec/acceptance/fake/app/models/faq.rb
|
|
135
|
-
- spec/acceptance/fake/app/models/news.rb
|
|
136
|
-
- spec/acceptance/fake/app/views/application.html.erb
|
|
137
|
-
- spec/acceptance/fake/semi_static_pages/event_planning_tips/erb_chained.md.erb
|
|
138
|
-
- spec/acceptance/fake/semi_static_pages/event_planning_tips/erb_page.erb
|
|
139
|
-
- spec/acceptance/fake/semi_static_pages/event_planning_tips/manner.md
|
|
140
|
-
- spec/acceptance/fake/semi_static_pages/event_planning_tips/multibyte-bang.md
|
|
141
|
-
- spec/acceptance/fake/semi_static_pages/event_planning_tips/non_standard_slug.md
|
|
142
|
-
- spec/acceptance/fake/semi_static_pages/faqs/checkin_devices.md
|
|
143
|
-
- spec/acceptance/fake/semi_static_pages/news/2011-07-26-replaced-download.md
|
|
144
|
-
- spec/acceptance/news_spec.rb
|
|
145
|
-
- spec/acceptance/page_spec.rb
|
|
146
129
|
- spec/backend_spec.rb
|
|
130
|
+
- spec/features/acceptance_helper.rb
|
|
131
|
+
- spec/features/custom_controllers_spec.rb
|
|
132
|
+
- spec/features/fake/app.rb
|
|
133
|
+
- spec/features/fake/app/controllers/admin/faqs_controller.rb
|
|
134
|
+
- spec/features/fake/app/controllers/faqs_controller.rb
|
|
135
|
+
- spec/features/fake/app/models/event_planning_tip.rb
|
|
136
|
+
- spec/features/fake/app/models/faq.rb
|
|
137
|
+
- spec/features/fake/app/models/news.rb
|
|
138
|
+
- spec/features/fake/app/views/application.html.erb
|
|
139
|
+
- spec/features/fake/semi_static_pages/event_planning_tips/erb_chained.md.erb
|
|
140
|
+
- spec/features/fake/semi_static_pages/event_planning_tips/erb_page.erb
|
|
141
|
+
- spec/features/fake/semi_static_pages/event_planning_tips/manner.md
|
|
142
|
+
- spec/features/fake/semi_static_pages/event_planning_tips/multibyte-bang.md
|
|
143
|
+
- spec/features/fake/semi_static_pages/event_planning_tips/non_standard_slug.md
|
|
144
|
+
- spec/features/fake/semi_static_pages/faqs/checkin_devices.md
|
|
145
|
+
- spec/features/fake/semi_static_pages/news/2011-07-26-replaced-download.md
|
|
146
|
+
- spec/features/news_spec.rb
|
|
147
|
+
- spec/features/page_spec.rb
|
|
147
148
|
- spec/news_spec.rb
|
|
148
149
|
- spec/page_spec.rb
|
|
149
150
|
- spec/semi_static_pages/news/2011-07-26-replaced-download.md
|
|
@@ -167,30 +168,30 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
167
168
|
version: '0'
|
|
168
169
|
requirements: []
|
|
169
170
|
rubyforge_project: semi_static
|
|
170
|
-
rubygems_version: 2.2
|
|
171
|
+
rubygems_version: 2.5.2
|
|
171
172
|
signing_key:
|
|
172
173
|
specification_version: 4
|
|
173
174
|
summary: Text file based CMS for Rails
|
|
174
175
|
test_files:
|
|
175
|
-
- spec/acceptance/acceptance_helper.rb
|
|
176
|
-
- spec/acceptance/custom_controllers_spec.rb
|
|
177
|
-
- spec/acceptance/fake/app.rb
|
|
178
|
-
- spec/acceptance/fake/app/controllers/admin/faqs_controller.rb
|
|
179
|
-
- spec/acceptance/fake/app/controllers/faqs_controller.rb
|
|
180
|
-
- spec/acceptance/fake/app/models/event_planning_tip.rb
|
|
181
|
-
- spec/acceptance/fake/app/models/faq.rb
|
|
182
|
-
- spec/acceptance/fake/app/models/news.rb
|
|
183
|
-
- spec/acceptance/fake/app/views/application.html.erb
|
|
184
|
-
- spec/acceptance/fake/semi_static_pages/event_planning_tips/erb_chained.md.erb
|
|
185
|
-
- spec/acceptance/fake/semi_static_pages/event_planning_tips/erb_page.erb
|
|
186
|
-
- spec/acceptance/fake/semi_static_pages/event_planning_tips/manner.md
|
|
187
|
-
- spec/acceptance/fake/semi_static_pages/event_planning_tips/multibyte-bang.md
|
|
188
|
-
- spec/acceptance/fake/semi_static_pages/event_planning_tips/non_standard_slug.md
|
|
189
|
-
- spec/acceptance/fake/semi_static_pages/faqs/checkin_devices.md
|
|
190
|
-
- spec/acceptance/fake/semi_static_pages/news/2011-07-26-replaced-download.md
|
|
191
|
-
- spec/acceptance/news_spec.rb
|
|
192
|
-
- spec/acceptance/page_spec.rb
|
|
193
176
|
- spec/backend_spec.rb
|
|
177
|
+
- spec/features/acceptance_helper.rb
|
|
178
|
+
- spec/features/custom_controllers_spec.rb
|
|
179
|
+
- spec/features/fake/app.rb
|
|
180
|
+
- spec/features/fake/app/controllers/admin/faqs_controller.rb
|
|
181
|
+
- spec/features/fake/app/controllers/faqs_controller.rb
|
|
182
|
+
- spec/features/fake/app/models/event_planning_tip.rb
|
|
183
|
+
- spec/features/fake/app/models/faq.rb
|
|
184
|
+
- spec/features/fake/app/models/news.rb
|
|
185
|
+
- spec/features/fake/app/views/application.html.erb
|
|
186
|
+
- spec/features/fake/semi_static_pages/event_planning_tips/erb_chained.md.erb
|
|
187
|
+
- spec/features/fake/semi_static_pages/event_planning_tips/erb_page.erb
|
|
188
|
+
- spec/features/fake/semi_static_pages/event_planning_tips/manner.md
|
|
189
|
+
- spec/features/fake/semi_static_pages/event_planning_tips/multibyte-bang.md
|
|
190
|
+
- spec/features/fake/semi_static_pages/event_planning_tips/non_standard_slug.md
|
|
191
|
+
- spec/features/fake/semi_static_pages/faqs/checkin_devices.md
|
|
192
|
+
- spec/features/fake/semi_static_pages/news/2011-07-26-replaced-download.md
|
|
193
|
+
- spec/features/news_spec.rb
|
|
194
|
+
- spec/features/page_spec.rb
|
|
194
195
|
- spec/news_spec.rb
|
|
195
196
|
- spec/page_spec.rb
|
|
196
197
|
- spec/semi_static_pages/news/2011-07-26-replaced-download.md
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# encoding: UTF-8
|
|
2
|
-
require File.expand_path(File.dirname(__FILE__) + '/acceptance_helper')
|
|
3
|
-
|
|
4
|
-
feature 'news' do
|
|
5
|
-
scenario "index" do
|
|
6
|
-
visit news_index_path
|
|
7
|
-
page.find("h1 a").text.should == "請求書のダウンロードが可能になりました"
|
|
8
|
-
page.find("date").text.should == "July 26, 2011"
|
|
9
|
-
page.find("p").text.should == "各請求書のページに「ダウンロード」ボタンを設置し、作成した請求書をPDFファイルとしてダウンロードできるようになりました。"
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
scenario 'show markdown page' do
|
|
13
|
-
visit "/news/2011/7/26/#{CGI.escape("請求書のダウンロードが可能になりました")}"
|
|
14
|
-
page.find("h1").text.should == "請求書のダウンロードが可能になりました"
|
|
15
|
-
page.find("date").text.should == "July 26, 2011"
|
|
16
|
-
page.find("p").text.should == "各請求書のページに「ダウンロード」ボタンを設置し、作成した請求書をPDFファイルとしてダウンロードできるようになりました。"
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
scenario 'show non-existant page' do
|
|
20
|
-
visit "/news/1999/1/23/foo"
|
|
21
|
-
page.status_code.should == 404
|
|
22
|
-
end
|
|
23
|
-
end
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
# encoding: UTF-8
|
|
2
|
-
require File.expand_path(File.dirname(__FILE__) + '/acceptance_helper')
|
|
3
|
-
|
|
4
|
-
feature 'page' do
|
|
5
|
-
scenario "index" do
|
|
6
|
-
visit '/event_planning_tips'
|
|
7
|
-
page.should have_css("h1 a")
|
|
8
|
-
page.should have_content("イベント時に気をつけたいマナー")
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
scenario 'show markdown page' do
|
|
12
|
-
visit "/event_planning_tips/#{CGI.escape("イベント時に気をつけたいマナー")}"
|
|
13
|
-
page.find("h1").text.should == "イベント時に気をつけたいマナー"
|
|
14
|
-
page.find("section h2").text.should == "1. 無断に写真や動画の撮影、公開しない"
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
scenario 'show multibyte bang' do
|
|
18
|
-
visit "/event_planning_tips/#{CGI.escape("イベントやろう")}"
|
|
19
|
-
current_path.should == "/event_planning_tips/#{CGI.escape("イベントやろう")}"
|
|
20
|
-
page.find("h1").text.should == "イベントやろう!"
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
scenario 'show erb page' do
|
|
24
|
-
visit "/event_planning_tips/erb-test"
|
|
25
|
-
page.find(".erb").text.should == "1 + 1 = 2"
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
scenario 'show erb chained' do
|
|
29
|
-
visit "/event_planning_tips/erb-chained"
|
|
30
|
-
page.find("h2").text.should == "1 + 1 = 2"
|
|
31
|
-
page.should have_css "img"
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
scenario 'non standard slug' do
|
|
35
|
-
visit "/event_planning_tips/non-standard-slug"
|
|
36
|
-
page.find("h1").text.should == "Title is different than slug"
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
scenario 'slug is not validly encoded' do
|
|
40
|
-
visit "/event_planning_tips/%8e%8f"
|
|
41
|
-
page.status_code.should == 400
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
scenario 'redirect in case of double escape' do
|
|
45
|
-
visit "/event_planning_tips/#{CGI.escape(CGI.escape("イベントやろう"))}"
|
|
46
|
-
current_path.should == "/event_planning_tips/#{CGI.escape("イベントやろう")}"
|
|
47
|
-
page.find("h1").text.should == "イベントやろう!"
|
|
48
|
-
end
|
|
49
|
-
end
|