semi_static 0.6.1 → 0.7.3

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.
Files changed (34) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +9 -0
  3. data/Gemfile +1 -1
  4. data/LICENSE +21 -0
  5. data/lib/semi_static/controller/page.rb +2 -2
  6. data/lib/semi_static/tilt_wrapper.rb +0 -2
  7. data/lib/semi_static/version.rb +1 -1
  8. data/semi_static.gemspec +3 -2
  9. data/spec/backend_spec.rb +4 -4
  10. data/spec/{acceptance → features}/acceptance_helper.rb +1 -0
  11. data/spec/features/custom_controllers_spec.rb +31 -0
  12. data/spec/{acceptance → features}/fake/app.rb +0 -0
  13. data/spec/{acceptance → features}/fake/app/controllers/admin/faqs_controller.rb +1 -1
  14. data/spec/{acceptance → features}/fake/app/controllers/faqs_controller.rb +2 -1
  15. data/spec/{acceptance → features}/fake/app/models/event_planning_tip.rb +0 -0
  16. data/spec/features/fake/app/models/faq.rb +6 -0
  17. data/spec/{acceptance → features}/fake/app/models/news.rb +0 -0
  18. data/spec/{acceptance → features}/fake/app/views/application.html.erb +0 -0
  19. data/spec/{acceptance → features}/fake/semi_static_pages/event_planning_tips/erb_chained.md.erb +0 -0
  20. data/spec/{acceptance → features}/fake/semi_static_pages/event_planning_tips/erb_page.erb +0 -0
  21. data/spec/{acceptance → features}/fake/semi_static_pages/event_planning_tips/manner.md +0 -0
  22. data/spec/{acceptance → features}/fake/semi_static_pages/event_planning_tips/multibyte-bang.md +0 -0
  23. data/spec/{acceptance → features}/fake/semi_static_pages/event_planning_tips/non_standard_slug.md +0 -0
  24. data/spec/{acceptance → features}/fake/semi_static_pages/faqs/checkin_devices.md +0 -0
  25. data/spec/{acceptance → features}/fake/semi_static_pages/news/2011-07-26-replaced-download.md +0 -0
  26. data/spec/features/news_spec.rb +23 -0
  27. data/spec/features/page_spec.rb +49 -0
  28. data/spec/news_spec.rb +3 -3
  29. data/spec/page_spec.rb +9 -9
  30. metadata +52 -50
  31. data/spec/acceptance/custom_controllers_spec.rb +0 -19
  32. data/spec/acceptance/fake/app/models/faq.rb +0 -3
  33. data/spec/acceptance/news_spec.rb +0 -23
  34. data/spec/acceptance/page_spec.rb +0 -49
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: d2a570ebbf1dfc80d2135f26a69597f07ee70136
4
- data.tar.gz: 850071b2fce09be73ec0f4a57028abd832254d84
2
+ SHA256:
3
+ metadata.gz: f60d927d351c3d3d77f485ac6868736a7e1d067c5883809f9762976869ac84c8
4
+ data.tar.gz: 74f65648b7943d572f3b72eb4f1651741f8bacaaa3e63df49084a8b1775f9e8d
5
5
  SHA512:
6
- metadata.gz: 631756292ac004a3cc3ed1e53d5b8ccc34a3c7e60cfc8a8731bb117f6eaa3c9bf055852a5012166e5d3b8697cd093e5676565d9d7001f3b708905df9bb42d011
7
- data.tar.gz: 0491bc47e54ad39f6341aaaa787febc6e7ae8e2adfd09190a3ee834180c8c16bbdc51f49515032d347339d511a2ef4bc74b36ff202a7b9e176360be593ecbc3e
6
+ metadata.gz: dc4ac37f779c387a409d5e0c93f5d37dfb2ae6f98cb46cc088b247737901121ab9b486c8e342e7dea13aa693e5ce70f12827b1b8c26cbd3e2140f8440ce56e43
7
+ data.tar.gz: d1c635c728084e2f6d3cbd0558f0b473653a32662244a43d2a987df7cf22dde76b8a555e18d480b0578536670a456aa82b4492d97bdd1dcf546ce4450b91642f
data/CHANGELOG.md ADDED
@@ -0,0 +1,9 @@
1
+ # CHANGELOG
2
+
3
+ ## v0.7.2
4
+
5
+ - Fix bug when redirecting to an article because the param doesn't match under a scoped route
6
+
7
+ ## v0.7.1
8
+
9
+ - Use request.env to avoid deprecation warning under Rails 5.
data/Gemfile CHANGED
@@ -3,4 +3,4 @@ source "http://rubygems.org"
3
3
  # Specify your gem's dependencies in semi_static.gemspec
4
4
  gemspec
5
5
 
6
- gem 'rails', '4.0.0.rc1'
6
+ gem 'rails', '>= 4.0'
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ Copyright (c) 2021 Doorkeeper Inc
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -12,13 +12,13 @@ module SemiStatic::Controller::Page
12
12
  raise ActionController::RoutingError.new(url_for(:id => params[:id], :only_path => true))
13
13
  end
14
14
  unless params[:id] == @article.to_param
15
- redirect_to @article, :status => :moved_permanently
15
+ redirect_to({id: @article}, status: :moved_permanently)
16
16
  end
17
17
  end
18
18
 
19
19
  private
20
20
 
21
21
  def resource
22
- env["semi_static.mapping"]
22
+ request.env["semi_static.mapping"]
23
23
  end
24
24
  end
@@ -1,5 +1,3 @@
1
- Tilt.register Tilt::RedcarpetTemplate::Redcarpet2, 'md' # hack to prefere redcarpet2
2
-
3
1
  class SemiStatic::TiltWrapper
4
2
  class << self
5
3
  def template(filename, body)
@@ -1,3 +1,3 @@
1
1
  module SemiStatic
2
- VERSION = "0.6.1"
2
+ VERSION = "0.7.3"
3
3
  end
data/semi_static.gemspec CHANGED
@@ -5,6 +5,7 @@ require "semi_static/version"
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "semi_static"
7
7
  s.version = SemiStatic::VERSION
8
+ s.licenses = ["MIT"]
8
9
  s.authors = ["Paul McMahon"]
9
10
  s.email = ["paul@mobalean.com"]
10
11
  s.homepage = "http://www.mobalean.com"
@@ -21,8 +22,8 @@ Gem::Specification.new do |s|
21
22
  s.add_dependency 'rails', '> 3.0'
22
23
  s.add_dependency 'redcarpet'
23
24
  s.add_dependency 'babosa'
24
- s.add_dependency 'tilt'
25
+ s.add_dependency 'tilt', '>= 1.3.4'
25
26
 
26
- s.add_development_dependency 'rspec-rails', '~> 2.0'
27
+ s.add_development_dependency 'rspec-rails', '>= 3.0'
27
28
  s.add_development_dependency 'capybara', '~> 2.1'
28
29
  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.should == 1 }
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.should == "請求書のダウンロードが可能になりました" }
20
- it { @item.published_at.should == Date.parse("2011-07-26") }
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 { should include("<br>") }
23
+ it { is_expected.to include("<br>") }
24
24
  end
25
25
  end
26
26
  end
@@ -1,4 +1,5 @@
1
1
  require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")
2
+ ENV['RAILS_ENV'] ||= 'test'
2
3
  require File.expand_path(File.dirname(__FILE__) + "/fake/app")
3
4
  require 'capybara/rspec'
4
5
 
@@ -0,0 +1,31 @@
1
+ # encoding: UTF-8
2
+ require File.expand_path(File.dirname(__FILE__) + '/acceptance_helper')
3
+
4
+ feature 'custom controllers', type: :feature do
5
+ scenario "index" do
6
+ visit faqs_path
7
+ expect(find("h1 a").text).to eq("チェックイン端末とはなんですか?")
8
+ end
9
+
10
+ scenario "overwritten method" do
11
+ visit faq_path(:id => "管理端末とはなんですか?")
12
+ expect(find("h1").text).to eq("チェックイン端末とはなんですか?")
13
+ end
14
+
15
+ scenario "partial match redirects" do
16
+ visit faq_path("チェックイン端末")
17
+ expect(page.current_path).to eq(faq_path("チェックイン端末とはなんですか"))
18
+ expect(find("h1").text).to eq("チェックイン端末とはなんですか?")
19
+ end
20
+
21
+ scenario "namespaced controller" do
22
+ visit admin_faqs_path
23
+ expect(find("body").text).to eq("Namespaced")
24
+ end
25
+
26
+ scenario "namespaced controller redirects" do
27
+ visit admin_faq_path("チェックイン端末")
28
+ expect(page.current_path).to eq(admin_faq_path("チェックイン端末とはなんですか"))
29
+ expect(find("h1").text).to eq("チェックイン端末とはなんですか?")
30
+ end
31
+ end
File without changes
@@ -1,6 +1,6 @@
1
1
  # encoding: UTF-8
2
2
  class Admin::FaqsController < SemiStatic::PageController
3
3
  def index
4
- render :text => "Namespaced"
4
+ render :plain => "Namespaced"
5
5
  end
6
6
  end
@@ -3,7 +3,8 @@ class FaqsController < SemiStatic::PageController
3
3
  def show
4
4
  case params[:id]
5
5
  when "管理端末とはなんですか?"
6
- redirect_to :id => "チェックイン端末とはなんですか?", :status => 301
6
+ article = resource.all.find {|a| a.title == "チェックイン端末とはなんですか?" }
7
+ redirect_to :id => article.to_param, :status => 301
7
8
  else
8
9
  super
9
10
  end
@@ -0,0 +1,6 @@
1
+ # encoding: UTF-8
2
+ class Faq < SemiStatic::Page
3
+ def self.find(param)
4
+ all.find {|a| a.to_param.match(/^#{Regexp.escape(param)}/)}
5
+ end
6
+ end
@@ -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 = mock(:all => [ @page ])
7
+ SemiStatic.backend = double(:all => [ @page ])
8
8
  end
9
9
 
10
- it { @page.to_param.should == "2001/1/31/ほげ" }
11
- it { News.find("2001/1/31/ほげ").should == @page }
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 = mock(:all => [ @japanese_page, @english_page ])
8
+ SemiStatic.backend = double(:all => [ @japanese_page, @english_page ])
9
9
  end
10
10
 
11
- it { @japanese_page.to_param.should == "ほげ" }
12
- it { @japanese_page.to_s.should == "ほげ" }
13
- it { @english_page.to_param.should == "foo-bar" }
14
- it { @english_page.to_s.should == "foo bar" }
15
- it { described_class.new(nil, {}).to_s.should == "" }
16
- it { SemiStatic::Page.find("foo-bar").should == @english_page }
17
- it { SemiStatic::Page.find("ほげ").should == @japanese_page }
18
- it { SemiStatic::Page.find(CGI.escape("ほげ")).should == @japanese_page }
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.6.1
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul McMahon
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-06 00:00:00.000000000 Z
11
+ date: 2021-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -58,28 +58,28 @@ dependencies:
58
58
  requirements:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: 1.3.4
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: 1.3.4
69
69
  - !ruby/object:Gem::Dependency
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: '2.0'
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: '2.0'
82
+ version: '3.0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: capybara
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -102,7 +102,9 @@ extensions: []
102
102
  extra_rdoc_files: []
103
103
  files:
104
104
  - ".gitignore"
105
+ - CHANGELOG.md
105
106
  - Gemfile
107
+ - LICENSE
106
108
  - README.md
107
109
  - Rakefile
108
110
  - app/controllers/semi_static/news_controller.rb
@@ -125,33 +127,34 @@ files:
125
127
  - lib/semi_static/tilt_wrapper.rb
126
128
  - lib/semi_static/version.rb
127
129
  - 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
130
  - spec/backend_spec.rb
131
+ - spec/features/acceptance_helper.rb
132
+ - spec/features/custom_controllers_spec.rb
133
+ - spec/features/fake/app.rb
134
+ - spec/features/fake/app/controllers/admin/faqs_controller.rb
135
+ - spec/features/fake/app/controllers/faqs_controller.rb
136
+ - spec/features/fake/app/models/event_planning_tip.rb
137
+ - spec/features/fake/app/models/faq.rb
138
+ - spec/features/fake/app/models/news.rb
139
+ - spec/features/fake/app/views/application.html.erb
140
+ - spec/features/fake/semi_static_pages/event_planning_tips/erb_chained.md.erb
141
+ - spec/features/fake/semi_static_pages/event_planning_tips/erb_page.erb
142
+ - spec/features/fake/semi_static_pages/event_planning_tips/manner.md
143
+ - spec/features/fake/semi_static_pages/event_planning_tips/multibyte-bang.md
144
+ - spec/features/fake/semi_static_pages/event_planning_tips/non_standard_slug.md
145
+ - spec/features/fake/semi_static_pages/faqs/checkin_devices.md
146
+ - spec/features/fake/semi_static_pages/news/2011-07-26-replaced-download.md
147
+ - spec/features/news_spec.rb
148
+ - spec/features/page_spec.rb
147
149
  - spec/news_spec.rb
148
150
  - spec/page_spec.rb
149
151
  - spec/semi_static_pages/news/2011-07-26-replaced-download.md
150
152
  - spec/spec_helper.rb
151
153
  homepage: http://www.mobalean.com
152
- licenses: []
154
+ licenses:
155
+ - MIT
153
156
  metadata: {}
154
- post_install_message:
157
+ post_install_message:
155
158
  rdoc_options: []
156
159
  require_paths:
157
160
  - lib
@@ -166,31 +169,30 @@ required_rubygems_version: !ruby/object:Gem::Requirement
166
169
  - !ruby/object:Gem::Version
167
170
  version: '0'
168
171
  requirements: []
169
- rubyforge_project: semi_static
170
- rubygems_version: 2.2.2
171
- signing_key:
172
+ rubygems_version: 3.2.15
173
+ signing_key:
172
174
  specification_version: 4
173
175
  summary: Text file based CMS for Rails
174
176
  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
177
  - spec/backend_spec.rb
178
+ - spec/features/acceptance_helper.rb
179
+ - spec/features/custom_controllers_spec.rb
180
+ - spec/features/fake/app.rb
181
+ - spec/features/fake/app/controllers/admin/faqs_controller.rb
182
+ - spec/features/fake/app/controllers/faqs_controller.rb
183
+ - spec/features/fake/app/models/event_planning_tip.rb
184
+ - spec/features/fake/app/models/faq.rb
185
+ - spec/features/fake/app/models/news.rb
186
+ - spec/features/fake/app/views/application.html.erb
187
+ - spec/features/fake/semi_static_pages/event_planning_tips/erb_chained.md.erb
188
+ - spec/features/fake/semi_static_pages/event_planning_tips/erb_page.erb
189
+ - spec/features/fake/semi_static_pages/event_planning_tips/manner.md
190
+ - spec/features/fake/semi_static_pages/event_planning_tips/multibyte-bang.md
191
+ - spec/features/fake/semi_static_pages/event_planning_tips/non_standard_slug.md
192
+ - spec/features/fake/semi_static_pages/faqs/checkin_devices.md
193
+ - spec/features/fake/semi_static_pages/news/2011-07-26-replaced-download.md
194
+ - spec/features/news_spec.rb
195
+ - spec/features/page_spec.rb
194
196
  - spec/news_spec.rb
195
197
  - spec/page_spec.rb
196
198
  - spec/semi_static_pages/news/2011-07-26-replaced-download.md
@@ -1,19 +0,0 @@
1
- # encoding: UTF-8
2
- require File.expand_path(File.dirname(__FILE__) + '/acceptance_helper')
3
-
4
- feature 'custom controllers' do
5
- scenario "index" do
6
- visit faqs_path
7
- find("h1 a").text.should == "チェックイン端末とはなんですか?"
8
- end
9
-
10
- scenario "overwritten method" do
11
- visit faq_path(:id => "管理端末とはなんですか?")
12
- find("h1").text.should == "チェックイン端末とはなんですか?"
13
- end
14
-
15
- scenario "namespaced controller" do
16
- visit admin_faqs_path
17
- find("body").text.should == "Namespaced"
18
- end
19
- end
@@ -1,3 +0,0 @@
1
- # encoding: UTF-8
2
- class Faq < SemiStatic::Page
3
- end
@@ -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