flowmor_router 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +175 -0
- data/Rakefile +34 -0
- data/app/controllers/application_controller.rb +2 -0
- data/app/controllers/static_controller.rb +2 -0
- data/app/models/routable_record.rb +121 -0
- data/bin/rails +12 -0
- data/config/routes.rb +21 -0
- data/lib/flowmor_router/engine.rb +4 -0
- data/lib/flowmor_router/exceptions.rb +3 -0
- data/lib/flowmor_router/version.rb +3 -0
- data/lib/flowmor_router.rb +24 -0
- data/lib/tasks/flowmor_router_tasks.rake +4 -0
- data/test/dummy/README.rdoc +28 -0
- data/test/dummy/Rakefile +6 -0
- data/test/dummy/app/assets/javascripts/application.js +13 -0
- data/test/dummy/app/assets/javascripts/blog.js +2 -0
- data/test/dummy/app/assets/javascripts/static.js +2 -0
- data/test/dummy/app/assets/stylesheets/application.css +15 -0
- data/test/dummy/app/assets/stylesheets/blog.css +4 -0
- data/test/dummy/app/assets/stylesheets/static.css +4 -0
- data/test/dummy/app/controllers/application_controller.rb +5 -0
- data/test/dummy/app/controllers/blog_controller.rb +9 -0
- data/test/dummy/app/controllers/static_controller.rb +2 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/helpers/blog_helper.rb +2 -0
- data/test/dummy/app/helpers/static_helper.rb +2 -0
- data/test/dummy/app/models/article.rb +3 -0
- data/test/dummy/app/models/news_article.rb +4 -0
- data/test/dummy/app/models/post.rb +18 -0
- data/test/dummy/app/models/post_category.rb +9 -0
- data/test/dummy/app/views/blog/show.html.erb +1 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/app/views/static/index.html.erb +3 -0
- data/test/dummy/bin/bundle +3 -0
- data/test/dummy/bin/rails +4 -0
- data/test/dummy/bin/rake +4 -0
- data/test/dummy/config/application.rb +23 -0
- data/test/dummy/config/boot.rb +5 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +37 -0
- data/test/dummy/config/environments/production.rb +82 -0
- data/test/dummy/config/environments/test.rb +39 -0
- data/test/dummy/config/initializers/assets.rb +8 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/dummy/config/initializers/inflections.rb +16 -0
- data/test/dummy/config/initializers/mime_types.rb +4 -0
- data/test/dummy/config/initializers/session_store.rb +3 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +23 -0
- data/test/dummy/config/routes.rb +56 -0
- data/test/dummy/config/secrets.yml +22 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/migrate/20140811154447_create_posts.rb +11 -0
- data/test/dummy/db/migrate/20140811155356_create_post_categories.rb +10 -0
- data/test/dummy/db/migrate/20140811182855_create_articles.rb +10 -0
- data/test/dummy/db/migrate/20140811184010_create_news_articles.rb +10 -0
- data/test/dummy/db/schema.rb +45 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +6 -0
- data/test/dummy/log/test.log +12740 -0
- data/test/dummy/public/404.html +67 -0
- data/test/dummy/public/422.html +67 -0
- data/test/dummy/public/500.html +66 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/test/controllers/static_controller_test.rb +10 -0
- data/test/dummy/test/fixtures/articles.yml +9 -0
- data/test/dummy/test/fixtures/news_articles.yml +9 -0
- data/test/dummy/test/fixtures/post_categories.yml +9 -0
- data/test/dummy/test/fixtures/posts.yml +11 -0
- data/test/dummy/test/helpers/blog_helper_test.rb +4 -0
- data/test/dummy/test/helpers/static_helper_test.rb +4 -0
- data/test/dummy/test/integration/routable_records_test.rb +12 -0
- data/test/dummy/test/models/article_test.rb +29 -0
- data/test/dummy/test/models/news_article_test.rb +50 -0
- data/test/dummy/test/models/post_category_test.rb +46 -0
- data/test/dummy/test/models/post_test.rb +50 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/2cdcb1089fe8a96b07fa1beb4356a3f2 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/2ef169e1ab9b9980404c3f7bd7b16cd1 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/66a7ff918272131011428741d7073461 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/66e7b4d1264df0176332685032844ce5 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/9bd4a825d7cf65dfa37efb43fe6b5aa7 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/a3ecd3c2fe5e4b3c4dd1365b4c108d06 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/c1a3b329f54c41592a0854a40f8425e0 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/efbfd84424b5a4f22bd23b73db9591a2 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/test/flowmor_router_test.rb +7 -0
- data/test/integration/navigation_test.rb +10 -0
- data/test/test_helper.rb +15 -0
- metadata +257 -0
@@ -0,0 +1,67 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The page you were looking for doesn't exist (404)</title>
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
+
<style>
|
7
|
+
body {
|
8
|
+
background-color: #EFEFEF;
|
9
|
+
color: #2E2F30;
|
10
|
+
text-align: center;
|
11
|
+
font-family: arial, sans-serif;
|
12
|
+
margin: 0;
|
13
|
+
}
|
14
|
+
|
15
|
+
div.dialog {
|
16
|
+
width: 95%;
|
17
|
+
max-width: 33em;
|
18
|
+
margin: 4em auto 0;
|
19
|
+
}
|
20
|
+
|
21
|
+
div.dialog > div {
|
22
|
+
border: 1px solid #CCC;
|
23
|
+
border-right-color: #999;
|
24
|
+
border-left-color: #999;
|
25
|
+
border-bottom-color: #BBB;
|
26
|
+
border-top: #B00100 solid 4px;
|
27
|
+
border-top-left-radius: 9px;
|
28
|
+
border-top-right-radius: 9px;
|
29
|
+
background-color: white;
|
30
|
+
padding: 7px 12% 0;
|
31
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
|
+
}
|
33
|
+
|
34
|
+
h1 {
|
35
|
+
font-size: 100%;
|
36
|
+
color: #730E15;
|
37
|
+
line-height: 1.5em;
|
38
|
+
}
|
39
|
+
|
40
|
+
div.dialog > p {
|
41
|
+
margin: 0 0 1em;
|
42
|
+
padding: 1em;
|
43
|
+
background-color: #F7F7F7;
|
44
|
+
border: 1px solid #CCC;
|
45
|
+
border-right-color: #999;
|
46
|
+
border-left-color: #999;
|
47
|
+
border-bottom-color: #999;
|
48
|
+
border-bottom-left-radius: 4px;
|
49
|
+
border-bottom-right-radius: 4px;
|
50
|
+
border-top-color: #DADADA;
|
51
|
+
color: #666;
|
52
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
53
|
+
}
|
54
|
+
</style>
|
55
|
+
</head>
|
56
|
+
|
57
|
+
<body>
|
58
|
+
<!-- This file lives in public/404.html -->
|
59
|
+
<div class="dialog">
|
60
|
+
<div>
|
61
|
+
<h1>The page you were looking for doesn't exist.</h1>
|
62
|
+
<p>You may have mistyped the address or the page may have moved.</p>
|
63
|
+
</div>
|
64
|
+
<p>If you are the application owner check the logs for more information.</p>
|
65
|
+
</div>
|
66
|
+
</body>
|
67
|
+
</html>
|
@@ -0,0 +1,67 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The change you wanted was rejected (422)</title>
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
+
<style>
|
7
|
+
body {
|
8
|
+
background-color: #EFEFEF;
|
9
|
+
color: #2E2F30;
|
10
|
+
text-align: center;
|
11
|
+
font-family: arial, sans-serif;
|
12
|
+
margin: 0;
|
13
|
+
}
|
14
|
+
|
15
|
+
div.dialog {
|
16
|
+
width: 95%;
|
17
|
+
max-width: 33em;
|
18
|
+
margin: 4em auto 0;
|
19
|
+
}
|
20
|
+
|
21
|
+
div.dialog > div {
|
22
|
+
border: 1px solid #CCC;
|
23
|
+
border-right-color: #999;
|
24
|
+
border-left-color: #999;
|
25
|
+
border-bottom-color: #BBB;
|
26
|
+
border-top: #B00100 solid 4px;
|
27
|
+
border-top-left-radius: 9px;
|
28
|
+
border-top-right-radius: 9px;
|
29
|
+
background-color: white;
|
30
|
+
padding: 7px 12% 0;
|
31
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
|
+
}
|
33
|
+
|
34
|
+
h1 {
|
35
|
+
font-size: 100%;
|
36
|
+
color: #730E15;
|
37
|
+
line-height: 1.5em;
|
38
|
+
}
|
39
|
+
|
40
|
+
div.dialog > p {
|
41
|
+
margin: 0 0 1em;
|
42
|
+
padding: 1em;
|
43
|
+
background-color: #F7F7F7;
|
44
|
+
border: 1px solid #CCC;
|
45
|
+
border-right-color: #999;
|
46
|
+
border-left-color: #999;
|
47
|
+
border-bottom-color: #999;
|
48
|
+
border-bottom-left-radius: 4px;
|
49
|
+
border-bottom-right-radius: 4px;
|
50
|
+
border-top-color: #DADADA;
|
51
|
+
color: #666;
|
52
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
53
|
+
}
|
54
|
+
</style>
|
55
|
+
</head>
|
56
|
+
|
57
|
+
<body>
|
58
|
+
<!-- This file lives in public/422.html -->
|
59
|
+
<div class="dialog">
|
60
|
+
<div>
|
61
|
+
<h1>The change you wanted was rejected.</h1>
|
62
|
+
<p>Maybe you tried to change something you didn't have access to.</p>
|
63
|
+
</div>
|
64
|
+
<p>If you are the application owner check the logs for more information.</p>
|
65
|
+
</div>
|
66
|
+
</body>
|
67
|
+
</html>
|
@@ -0,0 +1,66 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>We're sorry, but something went wrong (500)</title>
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
+
<style>
|
7
|
+
body {
|
8
|
+
background-color: #EFEFEF;
|
9
|
+
color: #2E2F30;
|
10
|
+
text-align: center;
|
11
|
+
font-family: arial, sans-serif;
|
12
|
+
margin: 0;
|
13
|
+
}
|
14
|
+
|
15
|
+
div.dialog {
|
16
|
+
width: 95%;
|
17
|
+
max-width: 33em;
|
18
|
+
margin: 4em auto 0;
|
19
|
+
}
|
20
|
+
|
21
|
+
div.dialog > div {
|
22
|
+
border: 1px solid #CCC;
|
23
|
+
border-right-color: #999;
|
24
|
+
border-left-color: #999;
|
25
|
+
border-bottom-color: #BBB;
|
26
|
+
border-top: #B00100 solid 4px;
|
27
|
+
border-top-left-radius: 9px;
|
28
|
+
border-top-right-radius: 9px;
|
29
|
+
background-color: white;
|
30
|
+
padding: 7px 12% 0;
|
31
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
|
+
}
|
33
|
+
|
34
|
+
h1 {
|
35
|
+
font-size: 100%;
|
36
|
+
color: #730E15;
|
37
|
+
line-height: 1.5em;
|
38
|
+
}
|
39
|
+
|
40
|
+
div.dialog > p {
|
41
|
+
margin: 0 0 1em;
|
42
|
+
padding: 1em;
|
43
|
+
background-color: #F7F7F7;
|
44
|
+
border: 1px solid #CCC;
|
45
|
+
border-right-color: #999;
|
46
|
+
border-left-color: #999;
|
47
|
+
border-bottom-color: #999;
|
48
|
+
border-bottom-left-radius: 4px;
|
49
|
+
border-bottom-right-radius: 4px;
|
50
|
+
border-top-color: #DADADA;
|
51
|
+
color: #666;
|
52
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
53
|
+
}
|
54
|
+
</style>
|
55
|
+
</head>
|
56
|
+
|
57
|
+
<body>
|
58
|
+
<!-- This file lives in public/500.html -->
|
59
|
+
<div class="dialog">
|
60
|
+
<div>
|
61
|
+
<h1>We're sorry, but something went wrong.</h1>
|
62
|
+
</div>
|
63
|
+
<p>If you are the application owner check the logs for more information.</p>
|
64
|
+
</div>
|
65
|
+
</body>
|
66
|
+
</html>
|
File without changes
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class RoutableRecordsTest < ActionDispatch::IntegrationTest
|
4
|
+
test "/general/lets-test-this" do
|
5
|
+
post = Post.create(title: "Let's Test This")
|
6
|
+
assert_equal post.name, 'lets-test-this'
|
7
|
+
assert_equal "/general/lets-test-this", post.path
|
8
|
+
get post.path
|
9
|
+
assert_response :success
|
10
|
+
assert_select "h1", "Let's Test This"
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class ArticleTest < ActiveSupport::TestCase
|
4
|
+
test "article#controller_action" do
|
5
|
+
assert Article.new.controller_action, "article#show"
|
6
|
+
end
|
7
|
+
|
8
|
+
test "article#route_name" do
|
9
|
+
assert Article.new(title: "Dummy Article").route_name, 'articles_dummy_article'
|
10
|
+
end
|
11
|
+
|
12
|
+
test "article#route_name_prefix" do
|
13
|
+
assert Article.new(title: "Dummy Article").route_name_prefix, 'article'
|
14
|
+
end
|
15
|
+
|
16
|
+
test "article#derived_name_field_value" do
|
17
|
+
assert Article.new(title: "Dummy Article").derived_name_field_value, 'dummy-article'
|
18
|
+
end
|
19
|
+
|
20
|
+
test "article#path" do
|
21
|
+
assert_raise FlowmorRouter::UnroutableRecord do
|
22
|
+
Article.new(title: nil).path
|
23
|
+
end
|
24
|
+
assert_raise FlowmorRouter::UnroutableRecord do
|
25
|
+
Article.create(title: nil).path
|
26
|
+
end
|
27
|
+
assert Article.create(title: "Dummy Article").path, '/articles/dummy-article'
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class NewsArticleTest < ActiveSupport::TestCase
|
4
|
+
test "news_article#controller_action" do
|
5
|
+
assert_equal "news_article#show", NewsArticle.new.controller_action
|
6
|
+
end
|
7
|
+
|
8
|
+
test "news_article#route_name" do
|
9
|
+
assert_equal 'news_articles_dummy_news_article', NewsArticle.new(caption: "Dummy News Article").route_name
|
10
|
+
end
|
11
|
+
|
12
|
+
test "news_article#route_name_prefix" do
|
13
|
+
assert_equal 'news_articles', NewsArticle.new(caption: "Dummy News Article").route_name_prefix
|
14
|
+
end
|
15
|
+
|
16
|
+
test "news_article#derived_name_field_value" do
|
17
|
+
assert_equal 'Dummy News Article', NewsArticle.new(caption: "Dummy News Article").derived_name_field_value
|
18
|
+
end
|
19
|
+
|
20
|
+
test "news_article#new_name_value" do
|
21
|
+
assert_equal 'dummy-news-article', NewsArticle.new(caption: "Dummy News Article").new_name_value
|
22
|
+
end
|
23
|
+
|
24
|
+
test "news_article#slug" do
|
25
|
+
assert_equal 'dummy-news-article', NewsArticle.create(caption: "Dummy News Article").slug
|
26
|
+
end
|
27
|
+
|
28
|
+
test "NewsArticle#route_model" do
|
29
|
+
assert_equal 'news_article', NewsArticle.route_model
|
30
|
+
end
|
31
|
+
|
32
|
+
test "news_article#path" do
|
33
|
+
assert_raise FlowmorRouter::UnroutableRecord do
|
34
|
+
NewsArticle.new(caption: nil).path
|
35
|
+
end
|
36
|
+
assert_raise FlowmorRouter::UnroutableRecord do
|
37
|
+
NewsArticle.create(caption: nil).path
|
38
|
+
end
|
39
|
+
assert_equal '/news-articles/dummy-news-article', NewsArticle.create(caption: "Dummy News Article").path
|
40
|
+
end
|
41
|
+
|
42
|
+
test "news_article#url" do
|
43
|
+
assert_raise FlowmorRouter::UnroutableRecord do
|
44
|
+
NewsArticle.new(caption: nil).url
|
45
|
+
end
|
46
|
+
assert_raise FlowmorRouter::UnroutableRecord do
|
47
|
+
NewsArticle.create(caption: nil).url
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class PostCategoryCategoryTest < ActiveSupport::TestCase
|
4
|
+
test "post_category#controller_action" do
|
5
|
+
assert_equal "blog#category", PostCategory.new.controller_action
|
6
|
+
end
|
7
|
+
|
8
|
+
test "post_category#route_name" do
|
9
|
+
assert_equal 'categories_general', PostCategory.new(title: "General").route_name
|
10
|
+
end
|
11
|
+
|
12
|
+
test "post_category#route_name_prefix" do
|
13
|
+
assert_equal 'categories', PostCategory.new(title: "General").route_name_prefix
|
14
|
+
end
|
15
|
+
|
16
|
+
test "post_category#derived_name_field_value" do
|
17
|
+
assert_equal 'General', PostCategory.new(title: "General").derived_name_field_value
|
18
|
+
end
|
19
|
+
|
20
|
+
test "post_category#new_name_value" do
|
21
|
+
assert_equal 'general', PostCategory.new(title: "General").new_name_value
|
22
|
+
end
|
23
|
+
|
24
|
+
test "PostCategory#route_model" do
|
25
|
+
assert_equal 'post_category', PostCategory.route_model
|
26
|
+
end
|
27
|
+
|
28
|
+
test "post_category#path" do
|
29
|
+
assert_raise FlowmorRouter::UnroutableRecord do
|
30
|
+
PostCategory.new(title: nil).path
|
31
|
+
end
|
32
|
+
assert_raise FlowmorRouter::UnroutableRecord do
|
33
|
+
PostCategory.create(title: nil).path
|
34
|
+
end
|
35
|
+
assert_equal '/categories/general', PostCategory.create(title: "General").path
|
36
|
+
end
|
37
|
+
|
38
|
+
test "post_category#url" do
|
39
|
+
assert_raise FlowmorRouter::UnroutableRecord do
|
40
|
+
PostCategory.new(title: nil).url
|
41
|
+
end
|
42
|
+
assert_raise FlowmorRouter::UnroutableRecord do
|
43
|
+
PostCategory.create(title: nil).url
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class PostTest < ActiveSupport::TestCase
|
4
|
+
test "post#controller_action" do
|
5
|
+
assert_equal "blog#show", Post.new.controller_action
|
6
|
+
end
|
7
|
+
|
8
|
+
test "default category is 'general'" do
|
9
|
+
assert_equal 'general', Post.new.category_name
|
10
|
+
end
|
11
|
+
|
12
|
+
test "post#route_name" do
|
13
|
+
assert_equal 'posts_general_dummy_post', Post.new(title: "Dummy Post").route_name
|
14
|
+
end
|
15
|
+
|
16
|
+
test "post#route_name_prefix" do
|
17
|
+
assert_equal 'posts_general', Post.new(title: "Dummy Post").route_name_prefix
|
18
|
+
end
|
19
|
+
|
20
|
+
test "post#derived_name_field_value" do
|
21
|
+
assert_equal 'Dummy Post', Post.new(title: "Dummy Post").derived_name_field_value
|
22
|
+
end
|
23
|
+
|
24
|
+
test "post#new_name_value" do
|
25
|
+
assert_equal 'dummy-post', Post.new(title: "Dummy Post").new_name_value
|
26
|
+
end
|
27
|
+
|
28
|
+
test "Post#route_model" do
|
29
|
+
assert_equal 'post', Post.route_model
|
30
|
+
end
|
31
|
+
|
32
|
+
test "post#path" do
|
33
|
+
assert_raise FlowmorRouter::UnroutableRecord do
|
34
|
+
Post.new(title: nil).path
|
35
|
+
end
|
36
|
+
assert_raise FlowmorRouter::UnroutableRecord do
|
37
|
+
Post.create(title: nil).path
|
38
|
+
end
|
39
|
+
assert_equal '/general/dummy-post', Post.create(title: "Dummy Post").path
|
40
|
+
end
|
41
|
+
|
42
|
+
test "post#url" do
|
43
|
+
assert_raise FlowmorRouter::UnroutableRecord do
|
44
|
+
Post.new(title: nil).url
|
45
|
+
end
|
46
|
+
assert_raise FlowmorRouter::UnroutableRecord do
|
47
|
+
Post.create(title: nil).url
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# Configure Rails Environment
|
2
|
+
ENV["RAILS_ENV"] = "test"
|
3
|
+
|
4
|
+
require File.expand_path("../dummy/config/environment.rb", __FILE__)
|
5
|
+
require "rails/test_help"
|
6
|
+
|
7
|
+
Rails.backtrace_cleaner.remove_silencers!
|
8
|
+
|
9
|
+
# Load support files
|
10
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
11
|
+
|
12
|
+
# Load fixtures from the engine
|
13
|
+
if ActiveSupport::TestCase.method_defined?(:fixture_path=)
|
14
|
+
ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
|
15
|
+
end
|