seiten 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/seiten/pages_controller.rb +1 -5
- data/lib/seiten/page.rb +20 -0
- data/lib/seiten/page_store.rb +25 -15
- data/lib/seiten/routes_helper.rb +1 -1
- data/lib/seiten/version.rb +1 -1
- data/lib/seiten.rb +1 -0
- data/test/dummy/log/development.log +2672 -6850
- data/test/dummy/log/test.log +7161 -6927
- data/test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
- data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/test/dummy/tmp/pids/server.pid +1 -1
- data/test/integration/i18n_test.rb +2 -8
- data/test/page_store_test.rb +28 -0
- data/test/page_test.rb +24 -0
- data/test/seiten_test.rb +4 -2
- metadata +26 -38
Binary file
|
Binary file
|
Binary file
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
47202
|
@@ -2,20 +2,14 @@ require 'test_helper'
|
|
2
2
|
|
3
3
|
class I18nTest < ActionDispatch::IntegrationTest
|
4
4
|
|
5
|
-
def test_returns_page_in_root_if_not_found_in_locale_directory
|
6
|
-
visit "/localization"
|
7
|
-
assert_equal 200, status_code
|
8
|
-
assert has_content?("I18n is in root")
|
9
|
-
end
|
10
|
-
|
11
5
|
def test_returns_products_page_in_en_directory
|
12
|
-
|
6
|
+
Seiten::PageStore.set_current_page_store(storage_language: :en)
|
13
7
|
visit "/products"
|
14
8
|
assert has_content?("This is the products page")
|
15
9
|
end
|
16
10
|
|
17
11
|
def test_returns_products_page_in_de_directory
|
18
|
-
|
12
|
+
Seiten::PageStore.set_current_page_store(storage_language: :de)
|
19
13
|
visit "/produkte"
|
20
14
|
assert has_content?("Das ist die Produkte Seite")
|
21
15
|
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class PageStoreTest < Test::Unit::TestCase
|
4
|
+
|
5
|
+
def test_returns_storages
|
6
|
+
assert_equal 2, Seiten::PageStore.storages.count
|
7
|
+
end
|
8
|
+
|
9
|
+
# TODO: Split into two tests
|
10
|
+
def test_sets_and_returns_current_page_store
|
11
|
+
page_store = Seiten::PageStore.find_by(storage_language: :de)
|
12
|
+
Seiten::PageStore.set_current_page_store(storage_language: :de)
|
13
|
+
assert_equal page_store, Seiten::PageStore.current
|
14
|
+
Seiten::PageStore.set_current_page_store(storage_language: :en)
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_find_by_with_one_argument
|
18
|
+
page_store = Seiten::PageStore.find_by(storage_language: :de)
|
19
|
+
assert_equal File.join(Rails.root, "config", "navigation", "de.yml"), page_store.storage_file
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_find_by_with_multiple_arguments
|
23
|
+
page_store = Seiten::PageStore.find_by(storage_language: :de, storage_file: File.join(Rails.root, "config", "navigation", "de.yml"))
|
24
|
+
assert_equal File.join(Rails.root, "config", "navigation", "de.yml"), page_store.storage_file
|
25
|
+
end
|
26
|
+
|
27
|
+
# TODO: Write more tests
|
28
|
+
end
|
data/test/page_test.rb
CHANGED
@@ -23,11 +23,35 @@ class PageTest < Test::Unit::TestCase
|
|
23
23
|
assert_equal "home", Seiten::Page.find(1).layout
|
24
24
|
end
|
25
25
|
|
26
|
+
def test_returns_external?
|
27
|
+
assert_equal true, Seiten::Page.find(13).external?
|
28
|
+
assert_equal false, Seiten::Page.find(4).external?
|
29
|
+
end
|
30
|
+
|
26
31
|
def test_returns_parent_page
|
27
32
|
page = Seiten::Page.find(3)
|
28
33
|
assert_equal Seiten::Page.find(2).title, page.parent.title
|
29
34
|
end
|
30
35
|
|
36
|
+
def test_returns_true_if_page_has_a_parent
|
37
|
+
page = Seiten::Page.find(3)
|
38
|
+
assert_equal true, page.parent?
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_returns_false_if_page_has_no_parent
|
42
|
+
page = Seiten::Page.find(1)
|
43
|
+
assert_equal false, page.parent?
|
44
|
+
end
|
45
|
+
|
46
|
+
def test_returns_branch_root_page
|
47
|
+
page = Seiten::Page.find(13)
|
48
|
+
assert_equal Seiten::Page.find(6), page.branch_root
|
49
|
+
page = Seiten::Page.find(3)
|
50
|
+
assert_equal Seiten::Page.find(2), page.branch_root
|
51
|
+
page = Seiten::Page.find(1)
|
52
|
+
assert_equal Seiten::Page.find(1), page.branch_root
|
53
|
+
end
|
54
|
+
|
31
55
|
def test_returns_children_pages
|
32
56
|
page = Seiten::Page.find(2)
|
33
57
|
assert_equal ["Logo Design", "Web Development", "Hire us"], page.children.map(&:title)
|
data/test/seiten_test.rb
CHANGED
@@ -3,7 +3,9 @@ require 'test_helper'
|
|
3
3
|
class SeitenTest < ActiveSupport::TestCase
|
4
4
|
|
5
5
|
def test_returns_page_storage_path
|
6
|
-
|
7
|
-
assert_equal File.join(Rails.root, "app/pages/en/
|
6
|
+
Seiten::PageStore.set_current_page_store(storage_language: :en)
|
7
|
+
assert_equal File.join(Rails.root, "app/pages/en/home.html.erb"), Seiten::PageStore.current.file_path(filename: "home.html.erb")
|
8
|
+
Seiten::PageStore.set_current_page_store(storage_language: :de)
|
9
|
+
assert_equal File.join(Rails.root, "app/pages/de/kontakt.html.erb"), Seiten::PageStore.current.file_path(filename: "kontakt.html.erb")
|
8
10
|
end
|
9
11
|
end
|
metadata
CHANGED
@@ -1,71 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: seiten
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Puglisi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 3.2.0
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - '>='
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: 3.2.0
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rails
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ~>
|
17
|
+
- - "~>"
|
32
18
|
- !ruby/object:Gem::Version
|
33
19
|
version: '3.2'
|
34
20
|
type: :development
|
35
21
|
prerelease: false
|
36
22
|
version_requirements: !ruby/object:Gem::Requirement
|
37
23
|
requirements:
|
38
|
-
- - ~>
|
24
|
+
- - "~>"
|
39
25
|
- !ruby/object:Gem::Version
|
40
26
|
version: '3.2'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: sqlite3
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
44
30
|
requirements:
|
45
|
-
- - ~>
|
31
|
+
- - "~>"
|
46
32
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.3
|
33
|
+
version: '1.3'
|
48
34
|
type: :development
|
49
35
|
prerelease: false
|
50
36
|
version_requirements: !ruby/object:Gem::Requirement
|
51
37
|
requirements:
|
52
|
-
- - ~>
|
38
|
+
- - "~>"
|
53
39
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.3
|
40
|
+
version: '1.3'
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
name: capybara
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
58
44
|
requirements:
|
59
|
-
- - ~>
|
45
|
+
- - "~>"
|
60
46
|
- !ruby/object:Gem::Version
|
61
|
-
version: 2.1
|
47
|
+
version: '2.1'
|
62
48
|
type: :development
|
63
49
|
prerelease: false
|
64
50
|
version_requirements: !ruby/object:Gem::Requirement
|
65
51
|
requirements:
|
66
|
-
- - ~>
|
52
|
+
- - "~>"
|
67
53
|
- !ruby/object:Gem::Version
|
68
|
-
version: 2.1
|
54
|
+
version: '2.1'
|
69
55
|
description: Seiten lets you create static pages for your Rails project and provides
|
70
56
|
you with some cool navigational helper likes breadcrumb or custom navigations.
|
71
57
|
email:
|
@@ -74,41 +60,44 @@ executables: []
|
|
74
60
|
extensions: []
|
75
61
|
extra_rdoc_files: []
|
76
62
|
files:
|
63
|
+
- MIT-LICENSE
|
64
|
+
- Rakefile
|
77
65
|
- app/controllers/seiten/pages_controller.rb
|
78
66
|
- app/helpers/seiten_helper.rb
|
79
67
|
- config/initializers/seiten.rb
|
68
|
+
- lib/seiten.rb
|
80
69
|
- lib/seiten/controllers/helpers.rb
|
81
70
|
- lib/seiten/engine.rb
|
82
71
|
- lib/seiten/page.rb
|
83
72
|
- lib/seiten/page_store.rb
|
84
73
|
- lib/seiten/routes_helper.rb
|
85
74
|
- lib/seiten/version.rb
|
86
|
-
- lib/seiten.rb
|
87
75
|
- lib/tasks/sticky_pages_tasks.rake
|
88
|
-
-
|
89
|
-
- Rakefile
|
76
|
+
- test/dummy/README.rdoc
|
77
|
+
- test/dummy/Rakefile
|
90
78
|
- test/dummy/app/assets/javascripts/application.js
|
91
79
|
- test/dummy/app/assets/stylesheets/application.css
|
92
80
|
- test/dummy/app/controllers/application_controller.rb
|
93
81
|
- test/dummy/app/controllers/pages_controller.rb
|
94
82
|
- test/dummy/app/helpers/application_helper.rb
|
95
83
|
- test/dummy/app/pages/de/produkte.html.erb
|
84
|
+
- test/dummy/app/pages/en/about/our-team.html.erb
|
96
85
|
- test/dummy/app/pages/en/about/our-team/italy.html.erb
|
97
86
|
- test/dummy/app/pages/en/about/our-team/switzerland.html.erb
|
98
|
-
- test/dummy/app/pages/en/about/our-team.html.erb
|
99
87
|
- test/dummy/app/pages/en/about/partners.html.erb
|
100
88
|
- test/dummy/app/pages/en/about/works.html.erb
|
101
89
|
- test/dummy/app/pages/en/contact.html.erb
|
102
90
|
- test/dummy/app/pages/en/home.html.erb
|
91
|
+
- test/dummy/app/pages/en/products.html.erb
|
103
92
|
- test/dummy/app/pages/en/products/logo-design.html.erb
|
104
93
|
- test/dummy/app/pages/en/products/web-development.html.erb
|
105
|
-
- test/dummy/app/pages/en/products.html.erb
|
106
94
|
- test/dummy/app/pages/localization.html.erb
|
107
95
|
- test/dummy/app/views/layouts/application.html.erb
|
108
96
|
- test/dummy/app/views/layouts/home.html.erb
|
109
97
|
- test/dummy/app/views/layouts/products.html.erb
|
110
98
|
- test/dummy/app/views/layouts/team.html.erb
|
111
99
|
- test/dummy/app/views/pages/secret.html.erb
|
100
|
+
- test/dummy/config.ru
|
112
101
|
- test/dummy/config/application.rb
|
113
102
|
- test/dummy/config/boot.rb
|
114
103
|
- test/dummy/config/database.yml
|
@@ -123,11 +112,10 @@ files:
|
|
123
112
|
- test/dummy/config/initializers/session_store.rb
|
124
113
|
- test/dummy/config/initializers/wrap_parameters.rb
|
125
114
|
- test/dummy/config/locales/en.yml
|
115
|
+
- test/dummy/config/navigation.yml
|
126
116
|
- test/dummy/config/navigation/de.yml
|
127
117
|
- test/dummy/config/navigation/en.yml
|
128
|
-
- test/dummy/config/navigation.yml
|
129
118
|
- test/dummy/config/routes.rb
|
130
|
-
- test/dummy/config.ru
|
131
119
|
- test/dummy/db/development.sqlite3
|
132
120
|
- test/dummy/db/test.sqlite3
|
133
121
|
- test/dummy/log/development.log
|
@@ -136,8 +124,6 @@ files:
|
|
136
124
|
- test/dummy/public/422.html
|
137
125
|
- test/dummy/public/500.html
|
138
126
|
- test/dummy/public/favicon.ico
|
139
|
-
- test/dummy/Rakefile
|
140
|
-
- test/dummy/README.rdoc
|
141
127
|
- test/dummy/script/rails
|
142
128
|
- test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953
|
143
129
|
- test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705
|
@@ -147,6 +133,7 @@ files:
|
|
147
133
|
- test/integration/layout_test.rb
|
148
134
|
- test/integration/navigation_test.rb
|
149
135
|
- test/integration/redirect_test.rb
|
136
|
+
- test/page_store_test.rb
|
150
137
|
- test/page_test.rb
|
151
138
|
- test/seiten_test.rb
|
152
139
|
- test/test_helper.rb
|
@@ -160,17 +147,17 @@ require_paths:
|
|
160
147
|
- lib
|
161
148
|
required_ruby_version: !ruby/object:Gem::Requirement
|
162
149
|
requirements:
|
163
|
-
- -
|
150
|
+
- - ">="
|
164
151
|
- !ruby/object:Gem::Version
|
165
152
|
version: '0'
|
166
153
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
167
154
|
requirements:
|
168
|
-
- -
|
155
|
+
- - ">="
|
169
156
|
- !ruby/object:Gem::Version
|
170
157
|
version: '0'
|
171
158
|
requirements: []
|
172
159
|
rubyforge_project:
|
173
|
-
rubygems_version: 2.
|
160
|
+
rubygems_version: 2.2.2
|
174
161
|
signing_key:
|
175
162
|
specification_version: 4
|
176
163
|
summary: Static Pages for Rails.
|
@@ -235,6 +222,7 @@ test_files:
|
|
235
222
|
- test/integration/layout_test.rb
|
236
223
|
- test/integration/navigation_test.rb
|
237
224
|
- test/integration/redirect_test.rb
|
225
|
+
- test/page_store_test.rb
|
238
226
|
- test/page_test.rb
|
239
227
|
- test/seiten_test.rb
|
240
228
|
- test/test_helper.rb
|