alchemy_cms 2.4.1 → 2.5.0.b2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (163) hide show
  1. data/.travis.yml +1 -1
  2. data/README.md +18 -17
  3. data/alchemy_cms.gemspec +5 -10
  4. data/app/assets/images/alchemy/icons.png +0 -0
  5. data/app/assets/stylesheets/alchemy/archive.scss +27 -0
  6. data/app/assets/stylesheets/alchemy/base.scss +0 -51
  7. data/app/assets/stylesheets/alchemy/elements.scss +37 -2
  8. data/app/assets/stylesheets/alchemy/icons.scss +4 -0
  9. data/app/assets/stylesheets/alchemy/modules.scss +4 -0
  10. data/app/assets/stylesheets/alchemy/sitemap.scss +1 -1
  11. data/app/assets/stylesheets/alchemy/tables.scss +1 -1
  12. data/app/assets/stylesheets/alchemy/variables.scss +1 -0
  13. data/app/controllers/alchemy/admin/pages_controller.rb +1 -0
  14. data/app/controllers/alchemy/admin/pictures_controller.rb +22 -8
  15. data/app/controllers/alchemy/admin/resources_controller.rb +1 -1
  16. data/app/controllers/alchemy/admin/sites_controller.rb +6 -0
  17. data/app/controllers/alchemy/base_controller.rb +8 -0
  18. data/app/controllers/alchemy/elements_controller.rb +33 -3
  19. data/app/controllers/alchemy/messages_controller.rb +47 -40
  20. data/app/controllers/alchemy/pages_controller.rb +8 -31
  21. data/app/controllers/alchemy/pictures_controller.rb +64 -30
  22. data/app/helpers/alchemy/admin/base_helper.rb +7 -0
  23. data/app/helpers/alchemy/admin/pages_helper.rb +12 -0
  24. data/app/helpers/alchemy/elements_helper.rb +2 -0
  25. data/app/helpers/alchemy/pages_helper.rb +30 -10
  26. data/app/helpers/alchemy/url_helper.rb +1 -0
  27. data/app/models/alchemy/content.rb +1 -2
  28. data/app/models/alchemy/element.rb +47 -2
  29. data/app/models/alchemy/language.rb +27 -14
  30. data/app/models/alchemy/page.rb +1 -1
  31. data/app/models/alchemy/picture.rb +46 -41
  32. data/app/models/alchemy/site.rb +44 -0
  33. data/app/views/alchemy/admin/elements/_element_head.html.erb +1 -0
  34. data/app/views/alchemy/admin/languages/index.html.erb +23 -0
  35. data/app/views/alchemy/admin/pages/edit.html.erb +27 -1
  36. data/app/views/alchemy/admin/pages/fold.js.erb +1 -0
  37. data/app/views/alchemy/admin/partials/_upload_form.html.erb +2 -0
  38. data/app/views/alchemy/admin/pictures/_picture.html.erb +24 -2
  39. data/app/views/alchemy/admin/pictures/_tag_list.html.erb +5 -4
  40. data/app/views/alchemy/admin/pictures/create.js.erb +1 -9
  41. data/app/views/alchemy/admin/pictures/info.html.erb +42 -0
  42. data/app/views/alchemy/admin/resources/_form.html.erb +0 -2
  43. data/app/views/alchemy/admin/resources/_resource.html.erb +2 -1
  44. data/app/views/alchemy/admin/resources/index.html.erb +2 -1
  45. data/app/views/alchemy/elements/show.html.erb +1 -6
  46. data/app/views/alchemy/elements/show.js.erb +4 -10
  47. data/app/views/alchemy/essences/_essence_link_view.html.erb +1 -0
  48. data/app/views/alchemy/search/_form.html.erb +9 -6
  49. data/app/views/alchemy/search/_result.html.erb +1 -1
  50. data/bin/alchemy +13 -120
  51. data/config/alchemy/config.yml +7 -11
  52. data/config/alchemy/modules.yml +24 -12
  53. data/config/authorization_rules.rb +6 -2
  54. data/config/initializers/dragonfly.rb +20 -0
  55. data/config/locales/alchemy.de.yml +57 -28
  56. data/config/locales/alchemy.en.yml +18 -4
  57. data/config/routes.rb +4 -2
  58. data/db/migrate/20121121162313_switch_from_fleximage_to_dragonfly.rb +21 -0
  59. data/db/migrate/20121205155004_create_alchemy_sites.rb +14 -0
  60. data/db/migrate/20121211163003_add_public_to_alchemy_sites.rb +6 -0
  61. data/lib/alchemy/capistrano.rb +7 -2
  62. data/lib/alchemy/ferret_search.rb +84 -0
  63. data/lib/alchemy/picture_attributes.rb +29 -0
  64. data/lib/alchemy/seeder.rb +10 -16
  65. data/lib/alchemy/upgrader.rb +59 -8
  66. data/lib/alchemy/version.rb +1 -1
  67. data/lib/alchemy_cms.rb +7 -4
  68. data/lib/rails/generators/alchemy/deploy_script/templates/deploy.rb.tt +3 -0
  69. data/lib/rails/generators/alchemy/elements/elements_generator.rb +5 -1
  70. data/lib/rails/generators/alchemy/page_layouts/page_layouts_generator.rb +1 -0
  71. data/lib/rails/generators/alchemy/scaffold/files/{pages.html.erb → application.html.erb} +0 -0
  72. data/lib/rails/generators/alchemy/scaffold/scaffold_generator.rb +11 -20
  73. data/lib/rails/templates/alchemy.rb +1 -7
  74. data/lib/tasks/{database.rake → alchemy/db.rake} +1 -1
  75. data/lib/tasks/{install.rake → alchemy/install.rake} +9 -14
  76. data/lib/tasks/{upgrade.rake → alchemy/upgrade.rake} +1 -1
  77. data/spec/controllers/elements_controller_spec.rb +24 -9
  78. data/spec/controllers/pictures_controller_spec.rb +11 -8
  79. data/{app → spec/dummy/app}/views/alchemy/elements/_article_editor.html.erb +0 -0
  80. data/{app → spec/dummy/app}/views/alchemy/elements/_article_view.html.erb +0 -0
  81. data/{app → spec/dummy/app}/views/alchemy/elements/_headline_view.html.erb +0 -0
  82. data/{app → spec/dummy/app}/views/alchemy/elements/_news_view.html.erb +0 -0
  83. data/{app → spec/dummy/app}/views/alchemy/elements/_searchresult_view.html.erb +0 -0
  84. data/{app → spec/dummy/app}/views/alchemy/page_layouts/_standard.html.erb +0 -0
  85. data/spec/dummy/config/alchemy/elements.yml +86 -0
  86. data/spec/dummy/config/alchemy/page_layouts.yml +26 -0
  87. data/spec/dummy/config/application.rb +1 -1
  88. data/spec/dummy/db/migrate/20121121162313_switch_from_fleximage_to_dragonfly.rb +21 -0
  89. data/spec/dummy/db/migrate/20121205155004_create_alchemy_sites.rb +14 -0
  90. data/spec/dummy/db/migrate/20121211163003_add_public_to_alchemy_sites.rb +6 -0
  91. data/spec/dummy/db/schema.rb +21 -6
  92. data/spec/factories.rb +6 -2
  93. data/spec/integration/translation_integration_spec.rb +4 -18
  94. data/spec/models/element_spec.rb +4 -4
  95. data/spec/models/picture_spec.rb +37 -20
  96. data/spec/models/site_spec.rb +69 -0
  97. data/spec/routing_spec.rb +115 -115
  98. data/spec/spec_helper.rb +1 -3
  99. data/spec/support/alchemy/specs_helpers.rb +4 -4
  100. data/vendor/assets/javascripts/jquery_plugins/jquery.html5uploader.js +1 -1
  101. metadata +72 -96
  102. data/app/assets/stylesheets/alchemy/standard_set.css +0 -440
  103. data/app/views/alchemy/elements/_bild_editor.html.erb +0 -1
  104. data/app/views/alchemy/elements/_bild_text_editor.html.erb +0 -7
  105. data/app/views/alchemy/elements/_bild_text_view.html.erb +0 -9
  106. data/app/views/alchemy/elements/_bild_view.html.erb +0 -9
  107. data/app/views/alchemy/elements/_claim_editor.html.erb +0 -1
  108. data/app/views/alchemy/elements/_claim_view.html.erb +0 -1
  109. data/app/views/alchemy/elements/_contactform_editor.html.erb +0 -4
  110. data/app/views/alchemy/elements/_contactform_view.html.erb +0 -78
  111. data/app/views/alchemy/elements/_download_editor.html.erb +0 -4
  112. data/app/views/alchemy/elements/_download_view.html.erb +0 -7
  113. data/app/views/alchemy/elements/_footnote_editor.html.erb +0 -1
  114. data/app/views/alchemy/elements/_footnote_view.html.erb +0 -5
  115. data/app/views/alchemy/elements/_header_editor.html.erb +0 -1
  116. data/app/views/alchemy/elements/_header_view.html.erb +0 -1
  117. data/app/views/alchemy/elements/_headline_editor.html.erb +0 -1
  118. data/app/views/alchemy/elements/_image_mosaic_editor.html.erb +0 -3
  119. data/app/views/alchemy/elements/_image_mosaic_view.html.erb +0 -14
  120. data/app/views/alchemy/elements/_intro_editor.html.erb +0 -1
  121. data/app/views/alchemy/elements/_intro_image_text_editor.html.erb +0 -3
  122. data/app/views/alchemy/elements/_intro_image_text_view.html.erb +0 -16
  123. data/app/views/alchemy/elements/_intro_view.html.erb +0 -3
  124. data/app/views/alchemy/elements/_news_editor.html.erb +0 -3
  125. data/app/views/alchemy/elements/_searchresult_editor.html.erb +0 -4
  126. data/app/views/alchemy/elements/_sitemap_editor.html.erb +0 -3
  127. data/app/views/alchemy/elements/_sitemap_view.html.erb +0 -38
  128. data/app/views/alchemy/elements/_sitename_editor.html.erb +0 -1
  129. data/app/views/alchemy/elements/_sitename_view.html.erb +0 -1
  130. data/app/views/alchemy/elements/_subheadline_editor.html.erb +0 -1
  131. data/app/views/alchemy/elements/_subheadline_view.html.erb +0 -5
  132. data/app/views/alchemy/elements/_text_editor.html.erb +0 -1
  133. data/app/views/alchemy/elements/_text_view.html.erb +0 -3
  134. data/app/views/alchemy/page_layouts/_contact.html.erb +0 -14
  135. data/app/views/alchemy/page_layouts/_external.html.erb +0 -0
  136. data/app/views/alchemy/page_layouts/_intro.html.erb +0 -14
  137. data/app/views/alchemy/page_layouts/_layout_footer.html.erb +0 -14
  138. data/app/views/alchemy/page_layouts/_layout_header.html.erb +0 -14
  139. data/app/views/alchemy/page_layouts/_news.html.erb +0 -14
  140. data/app/views/alchemy/page_layouts/_newsletter_layout.html.erb +0 -1
  141. data/app/views/alchemy/page_layouts/_search.html.erb +0 -14
  142. data/app/views/alchemy/pictures/show.gif.flexi +0 -19
  143. data/app/views/alchemy/pictures/show.jpg.flexi +0 -19
  144. data/app/views/alchemy/pictures/show.png.flexi +0 -19
  145. data/app/views/alchemy/pictures/thumbnail.png.flexi +0 -13
  146. data/app/views/alchemy/pictures/zoom.jpg.flexi +0 -3
  147. data/app/views/alchemy/pictures/zoom.png.flexi +0 -3
  148. data/app/views/layouts/alchemy/pages.html.erb +0 -51
  149. data/config/alchemy/elements.yml +0 -274
  150. data/config/alchemy/page_layouts.yml +0 -75
  151. data/config/asset_packages.yml +0 -30
  152. data/config/initializers/localeapp.rb +0 -9
  153. data/lib/rails/generators/alchemy/plugin/files/translation.pot +0 -3
  154. data/lib/rails/generators/alchemy/plugin/files/translation_de.po +0 -3
  155. data/lib/rails/generators/alchemy/plugin/files/translation_en.po +0 -3
  156. data/lib/rails/generators/alchemy/plugin/plugin_generator.rb +0 -37
  157. data/lib/rails/generators/alchemy/plugin/templates/authorization_rules.rb +0 -34
  158. data/lib/rails/generators/alchemy/plugin/templates/config.yml +0 -30
  159. data/lib/rails/generators/alchemy/plugin/templates/init.rb +0 -1
  160. data/lib/rails/generators/alchemy/plugin/templates/plugin.rb +0 -0
  161. data/lib/rails/generators/alchemy/plugin/templates/routes.rb +0 -10
  162. data/lib/tasks/fleximage.rake +0 -154
  163. data/spec/dummy/app/views/layouts/.gitkeep +0 -0
@@ -4,34 +4,33 @@ describe "Translation integration" do
4
4
 
5
5
  context "in admin backend" do
6
6
 
7
- it "should be possible to set the locale of the admin backend via params" do
7
+ before do
8
8
  authorize_as_admin
9
+ end
10
+
11
+ it "should be possible to set the locale of the admin backend via params" do
9
12
  visit admin_dashboard_path(:locale => :de)
10
13
  page.should have_content('Willkommen')
11
14
  end
12
15
 
13
16
  it "should store the current locale in the session" do
14
- authorize_as_admin
15
17
  visit admin_dashboard_path(:locale => :de)
16
18
  visit admin_dashboard_path
17
19
  page.should have_content('Willkommen')
18
20
  end
19
21
 
20
22
  it "should be possible to change the current locale in the session" do
21
- authorize_as_admin
22
23
  visit admin_dashboard_path(:locale => :de)
23
24
  visit admin_dashboard_path(:locale => :en)
24
25
  page.should have_content('Welcome')
25
26
  end
26
27
 
27
28
  it "should not be possible to switch the locale of the admin backend to an unknown locale" do
28
- authorize_as_admin
29
29
  visit admin_dashboard_path(:locale => :ko)
30
30
  page.should have_content('Welcome')
31
31
  end
32
32
 
33
33
  it "should use the current users language setting if no other parameter is given" do
34
- authorize_as_admin(locale = nil)
35
34
  Alchemy::User.first.update_attributes(:language => :de)
36
35
  visit admin_dashboard_path
37
36
  page.should have_content('Willkommen')
@@ -39,17 +38,4 @@ describe "Translation integration" do
39
38
 
40
39
  end
41
40
 
42
- context "with translated header" do
43
-
44
- before do
45
- Capybara.current_driver = :rack_test_translated_header
46
- end
47
-
48
- it "should use the browsers language setting if no other parameter is given" do
49
- visit root_path
50
- ::I18n.locale.should == :de
51
- end
52
-
53
- end
54
-
55
41
  end
@@ -102,16 +102,16 @@ module Alchemy
102
102
 
103
103
  context "no description files are found" do
104
104
 
105
- before(:each) do
106
- FileUtils.mv(File.join(File.dirname(__FILE__), '..', '..', 'config', 'alchemy', 'elements.yml'), File.join(File.dirname(__FILE__), '..', '..', 'config', 'alchemy', 'elements.yml.bak'))
105
+ before do
106
+ FileUtils.mv(File.join(File.dirname(__FILE__), '../dummy/config/alchemy/elements.yml'), File.join(File.dirname(__FILE__), '../dummy/config/alchemy/elements.yml.bak'))
107
107
  end
108
108
 
109
109
  it "should raise an error" do
110
110
  expect { Element.descriptions }.to raise_error(LoadError)
111
111
  end
112
112
 
113
- after(:each) do
114
- FileUtils.mv(File.join(File.dirname(__FILE__), '..', '..', 'config', 'alchemy', 'elements.yml.bak'), File.join(File.dirname(__FILE__), '..', '..', 'config', 'alchemy', 'elements.yml'))
113
+ after do
114
+ FileUtils.mv(File.join(File.dirname(__FILE__), '../dummy/config/alchemy/elements.yml.bak'), File.join(File.dirname(__FILE__), '../dummy/config/alchemy/elements.yml'))
115
115
  end
116
116
 
117
117
  end
@@ -12,23 +12,25 @@ module Alchemy
12
12
  picture.should be_valid
13
13
  end
14
14
 
15
+ it "is not valid without image file" do
16
+ picture = Picture.new
17
+ picture.should_not be_valid
18
+ end
19
+
15
20
  describe '#suffix' do
16
21
 
17
22
  it "should return the suffix of original filename" do
18
- pic = stub_model(Picture, :image_filename => 'kitten.JPG')
23
+ pic = stub_model(Picture, :image_file_name => 'kitten.JPG')
24
+ pic.stub(:image_file).and_return(OpenStruct.new({:ext => 'jpg'}))
19
25
  pic.suffix.should == "jpg"
20
26
  end
21
27
 
22
28
  context "image has no suffix" do
23
-
24
- before(:each) do
25
- @pic = stub_model(Picture, :image_filename => 'kitten')
26
- end
27
-
28
29
  it "should return empty string" do
29
- @pic.suffix.should == ""
30
+ pic = stub_model(Picture, :image_file_name => 'kitten')
31
+ pic.stub(:image_file).and_return(OpenStruct.new({:ext => ''}))
32
+ pic.suffix.should == ""
30
33
  end
31
-
32
34
  end
33
35
 
34
36
  end
@@ -36,27 +38,24 @@ module Alchemy
36
38
  describe '#humanized_name' do
37
39
 
38
40
  it "should return a humanized version of original filename" do
39
- pic = stub_model(Picture, :image_filename => 'cute_kitten.JPG')
41
+ pic = stub_model(Picture, :image_file_name => 'cute_kitten.JPG')
42
+ pic.stub(:image_file).and_return(OpenStruct.new({:ext => 'jpg'}))
40
43
  pic.humanized_name.should == "Cute kitten"
41
44
  end
42
45
 
43
46
  it "should not remove incidents of suffix from filename" do
44
- pic = stub_model(Picture, :image_filename => 'cute_kitten_mo.jpgi.JPG')
47
+ pic = stub_model(Picture, :image_file_name => 'cute_kitten_mo.jpgi.JPG')
48
+ pic.stub(:image_file).and_return(OpenStruct.new({:ext => 'jpg'}))
45
49
  pic.humanized_name.should == "Cute kitten mo.jpgi"
46
50
  pic.humanized_name.should_not == "Cute kitten moi"
47
51
  end
48
52
 
49
53
  context "image has no suffix" do
50
-
51
- before(:each) do
52
- @pic = stub_model(Picture, :image_filename => 'cute_kitten')
53
- @pic.stub!(:suffix).and_return("")
54
- end
55
-
56
54
  it "should return humanized name" do
57
- @pic.humanized_name.should == "Cute kitten"
55
+ pic = stub_model(Picture, :image_file_name => 'cute_kitten')
56
+ pic.stub(:suffix).and_return("")
57
+ pic.humanized_name.should == "Cute kitten"
58
58
  end
59
-
60
59
  end
61
60
 
62
61
  end
@@ -76,11 +75,15 @@ module Alchemy
76
75
  end
77
76
 
78
77
  it "should convert crop true value into string" do
79
- p = [@pic.id, nil, 'crop', nil, nil, Rails.configuration.secret_token].join('-')
80
- digest = Digest::SHA1.hexdigest(p)[0..15]
78
+ digest = PictureAttributes.secure({:id => @pic.id, :crop => 'crop'})
81
79
  @pic.security_token(:crop => true).should == digest
82
80
  end
83
81
 
82
+ it "should always include picture id" do
83
+ digest = PictureAttributes.secure({:id => @pic.id})
84
+ @pic.security_token.should == digest
85
+ end
86
+
84
87
  end
85
88
 
86
89
  describe '.last_upload' do
@@ -119,5 +122,19 @@ module Alchemy
119
122
 
120
123
  end
121
124
 
125
+ describe '#destroy' do
126
+ context "a picture that is assigned in an essence" do
127
+
128
+ let(:essence_picture) { EssencePicture.create }
129
+ let(:picture) { FactoryGirl.create :picture }
130
+ before { essence_picture.update_attributes(:picture_id => picture.id) }
131
+
132
+ it "should raise error message" do
133
+ expect { picture.destroy }.to raise_error PictureInUseError
134
+ end
135
+
136
+ end
137
+ end
138
+
122
139
  end
123
140
  end
@@ -0,0 +1,69 @@
1
+ require 'spec_helper'
2
+
3
+ module Alchemy
4
+ describe Site do
5
+ let(:site) { FactoryGirl.create(:site) }
6
+ let(:another_site) { FactoryGirl.create(:site, name: 'Another Site', host: 'another.com') }
7
+
8
+ describe 'new instances' do
9
+ subject { FactoryGirl.build(:site) }
10
+
11
+ it 'should start out with on languages' do
12
+ subject.languages.should be_empty
13
+ end
14
+
15
+ context 'when being saved' do
16
+ context 'when it has no languages yet' do
17
+ it 'should automatically create a default language' do
18
+ subject.save!
19
+ subject.languages.count.should == 1
20
+ subject.languages.first.should be_default
21
+ end
22
+ end
23
+
24
+ context 'when it already has a language' do
25
+ let(:language) { FactoryGirl.build(:language, site: nil) }
26
+ before { subject.languages << language }
27
+
28
+ it 'should not create any additional languages' do
29
+ subject.languages.should == [language]
30
+
31
+ expect { subject.save! }.
32
+ to_not change(subject, "languages")
33
+ end
34
+ end
35
+ end
36
+ end
37
+
38
+ describe '.current' do
39
+ context 'when set to a site' do
40
+ before { Site.current = site }
41
+ specify "Language should be scoped to that site"
42
+ end
43
+
44
+ context 'when set to nil' do
45
+ before { Site.current = nil }
46
+ specify "Language should not be scoped to a site"
47
+ end
48
+ end
49
+
50
+ describe '#current?' do
51
+ subject { site.current? }
52
+
53
+ context 'when Site.current is set to the same site' do
54
+ before { Site.current = site }
55
+ it { should be_true }
56
+ end
57
+
58
+ context 'when Site.current is set to nil' do
59
+ before { Site.current = nil }
60
+ it { should be_false }
61
+ end
62
+
63
+ context 'when Site.current is set to a different site' do
64
+ before { Site.current = another_site }
65
+ it { should be_false }
66
+ end
67
+ end
68
+ end
69
+ end
@@ -2,7 +2,7 @@ require 'spec_helper'
2
2
 
3
3
  describe "The Routing", :type => :routing do
4
4
 
5
- before { @routes = Alchemy::Engine.routes }
5
+ before(:each) { @routes = Alchemy::Engine.routes }
6
6
 
7
7
  context "for downloads" do
8
8
 
@@ -10,44 +10,44 @@ describe "The Routing", :type => :routing do
10
10
  {
11
11
  :get => "/attachment/32/download/Presseveranstaltung.pdf"
12
12
  }.should route_to(
13
- :controller => "alchemy/attachments",
14
- :action => "download",
15
- :id => "32",
16
- :name => "Presseveranstaltung",
17
- :format => "pdf"
18
- )
13
+ :controller => "alchemy/attachments",
14
+ :action => "download",
15
+ :id => "32",
16
+ :name => "Presseveranstaltung",
17
+ :format => "pdf"
18
+ )
19
19
  end
20
20
 
21
21
  it "should have a route for legacy Alchemy 1.x downloads" do
22
22
  {
23
23
  :get => "/attachment/32/download?name=Presseveranstaltung.pdf"
24
24
  }.should route_to(
25
- :controller => "alchemy/attachments",
26
- :action => "download",
27
- :id => "32"
28
- )
25
+ :controller => "alchemy/attachments",
26
+ :action => "download",
27
+ :id => "32"
28
+ )
29
29
  end
30
30
 
31
31
  it "should have a route for legacy washAPP downloads" do
32
32
  {
33
33
  :get => "/wa_files/download/11"
34
34
  }.should route_to(
35
- :controller => "alchemy/attachments",
36
- :action => "download",
37
- :id => "11"
38
- )
35
+ :controller => "alchemy/attachments",
36
+ :action => "download",
37
+ :id => "11"
38
+ )
39
39
  end
40
40
 
41
41
  it "should have a route for legacy WebMate downloads" do
42
42
  {
43
43
  :get => "/uploads/files/0000/0028/Pressetext.pdf"
44
44
  }.should route_to(
45
- :controller => "alchemy/attachments",
46
- :action => "download",
47
- :id => "0028",
48
- :name => "Pressetext",
49
- :suffix => "pdf"
50
- )
45
+ :controller => "alchemy/attachments",
46
+ :action => "download",
47
+ :id => "0028",
48
+ :name => "Pressetext",
49
+ :suffix => "pdf"
50
+ )
51
51
  end
52
52
 
53
53
  end
@@ -60,11 +60,11 @@ describe "The Routing", :type => :routing do
60
60
  {
61
61
  :get => "/products/my-product"
62
62
  }.should route_to(
63
- :controller => "alchemy/pages",
64
- :action => "show",
65
- :level1 => "products",
66
- :urlname => "my-product"
67
- )
63
+ :controller => "alchemy/pages",
64
+ :action => "show",
65
+ :level1 => "products",
66
+ :urlname => "my-product"
67
+ )
68
68
  end
69
69
 
70
70
  context "and language" do
@@ -73,12 +73,12 @@ describe "The Routing", :type => :routing do
73
73
  {
74
74
  :get => "/de/products/my-product"
75
75
  }.should route_to(
76
- :controller => "alchemy/pages",
77
- :action => "show",
78
- :level1 => "products",
79
- :urlname => "my-product",
80
- :lang => "de"
81
- )
76
+ :controller => "alchemy/pages",
77
+ :action => "show",
78
+ :level1 => "products",
79
+ :urlname => "my-product",
80
+ :lang => "de"
81
+ )
82
82
  end
83
83
 
84
84
  end
@@ -91,12 +91,12 @@ describe "The Routing", :type => :routing do
91
91
  {
92
92
  :get => "/catalog/products/my-product"
93
93
  }.should route_to(
94
- :controller => "alchemy/pages",
95
- :action => "show",
96
- :level1 => "catalog",
97
- :level2 => "products",
98
- :urlname => "my-product"
99
- )
94
+ :controller => "alchemy/pages",
95
+ :action => "show",
96
+ :level1 => "catalog",
97
+ :level2 => "products",
98
+ :urlname => "my-product"
99
+ )
100
100
  end
101
101
 
102
102
  context "and language" do
@@ -105,13 +105,13 @@ describe "The Routing", :type => :routing do
105
105
  {
106
106
  :get => "/de/catalog/products/my-product"
107
107
  }.should route_to(
108
- :controller => "alchemy/pages",
109
- :action => "show",
110
- :level1 => "catalog",
111
- :level2 => "products",
112
- :urlname => "my-product",
113
- :lang => "de"
114
- )
108
+ :controller => "alchemy/pages",
109
+ :action => "show",
110
+ :level1 => "catalog",
111
+ :level2 => "products",
112
+ :urlname => "my-product",
113
+ :lang => "de"
114
+ )
115
115
  end
116
116
 
117
117
  end
@@ -124,13 +124,13 @@ describe "The Routing", :type => :routing do
124
124
  {
125
125
  :get => "/2011/12/08/my-post"
126
126
  }.should route_to(
127
- :controller => "alchemy/pages",
128
- :action => "show",
129
- :level1 => "2011",
130
- :level2 => "12",
131
- :level3 => "08",
132
- :urlname => "my-post"
133
- )
127
+ :controller => "alchemy/pages",
128
+ :action => "show",
129
+ :level1 => "2011",
130
+ :level2 => "12",
131
+ :level3 => "08",
132
+ :urlname => "my-post"
133
+ )
134
134
  end
135
135
 
136
136
  context "and language" do
@@ -139,14 +139,14 @@ describe "The Routing", :type => :routing do
139
139
  {
140
140
  :get => "/de/2011/12/08/my-post"
141
141
  }.should route_to(
142
- :controller => "alchemy/pages",
143
- :action => "show",
144
- :level1 => "2011",
145
- :level2 => "12",
146
- :level3 => "08",
147
- :urlname => "my-post",
148
- :lang => "de"
149
- )
142
+ :controller => "alchemy/pages",
143
+ :action => "show",
144
+ :level1 => "2011",
145
+ :level2 => "12",
146
+ :level3 => "08",
147
+ :urlname => "my-post",
148
+ :lang => "de"
149
+ )
150
150
  end
151
151
 
152
152
  end
@@ -161,97 +161,97 @@ describe "The Routing", :type => :routing do
161
161
  {
162
162
  :get => "/pictures/3/show/900x300/kitten.jpg"
163
163
  }.should route_to(
164
- :controller => "alchemy/pictures",
165
- :action => "show",
166
- :id => "3",
167
- :size => "900x300",
168
- :name => "kitten",
169
- :format => "jpg"
170
- )
164
+ :controller => "alchemy/pictures",
165
+ :action => "show",
166
+ :id => "3",
167
+ :size => "900x300",
168
+ :name => "kitten",
169
+ :format => "jpg"
170
+ )
171
171
  end
172
172
 
173
173
  it "should route to cropped show action" do
174
174
  {
175
175
  :get => "/pictures/3/show/900x300/crop/kitten.jpg"
176
176
  }.should route_to(
177
- :controller => "alchemy/pictures",
178
- :action => "show",
179
- :id => "3",
180
- :size => "900x300",
181
- :crop => "crop",
182
- :name => "kitten",
183
- :format => "jpg"
184
- )
177
+ :controller => "alchemy/pictures",
178
+ :action => "show",
179
+ :id => "3",
180
+ :size => "900x300",
181
+ :crop => "crop",
182
+ :name => "kitten",
183
+ :format => "jpg"
184
+ )
185
185
  end
186
186
 
187
187
  it "should route to cropped mask show action" do
188
188
  get(
189
189
  "/pictures/3/show/300x300/crop/200x50/100x100/kitten.jpg"
190
190
  ).should route_to(
191
- :controller => "alchemy/pictures",
192
- :action => "show",
193
- :id => "3",
194
- :size => "300x300",
195
- :crop => "crop",
196
- :crop_from => "200x50",
197
- :crop_size => "100x100",
198
- :name => "kitten",
199
- :format => "jpg"
200
- )
191
+ :controller => "alchemy/pictures",
192
+ :action => "show",
193
+ :id => "3",
194
+ :size => "300x300",
195
+ :crop => "crop",
196
+ :crop_from => "200x50",
197
+ :crop_size => "100x100",
198
+ :name => "kitten",
199
+ :format => "jpg"
200
+ )
201
201
  end
202
202
 
203
203
  it "should route to thumbnail action" do
204
204
  get(
205
205
  "/pictures/3/thumbnails/small/kitten.jpg"
206
206
  ).should route_to(
207
- :controller => "alchemy/pictures",
208
- :action => "thumbnail",
209
- :id => "3",
210
- :size => "small",
211
- :name => "kitten",
212
- :format => "jpg"
213
- )
207
+ :controller => "alchemy/pictures",
208
+ :action => "thumbnail",
209
+ :id => "3",
210
+ :size => "small",
211
+ :name => "kitten",
212
+ :format => "jpg"
213
+ )
214
214
  end
215
215
 
216
216
  it "should route to cropped thumbnail action" do
217
217
  get(
218
218
  "/pictures/3/thumbnails/small/crop/kitten.jpg"
219
219
  ).should route_to(
220
- :controller => "alchemy/pictures",
221
- :action => "thumbnail",
222
- :id => "3",
223
- :crop => "crop",
224
- :size => "small",
225
- :name => "kitten",
226
- :format => "jpg"
227
- )
220
+ :controller => "alchemy/pictures",
221
+ :action => "thumbnail",
222
+ :id => "3",
223
+ :crop => "crop",
224
+ :size => "small",
225
+ :name => "kitten",
226
+ :format => "jpg"
227
+ )
228
228
  end
229
229
 
230
230
  it "should route to cropped and masked thumbnail" do
231
231
  get(
232
232
  "/pictures/3/thumbnails/small/0x0/200x200/kitten.jpg"
233
233
  ).should route_to(
234
- :controller => "alchemy/pictures",
235
- :action => "thumbnail",
236
- :id => "3",
237
- :crop_from => "0x0",
238
- :crop_size => "200x200",
239
- :size => "small",
240
- :name => "kitten",
241
- :format => "jpg"
242
- )
234
+ :controller => "alchemy/pictures",
235
+ :action => "thumbnail",
236
+ :id => "3",
237
+ :crop_from => "0x0",
238
+ :crop_size => "200x200",
239
+ :size => "small",
240
+ :name => "kitten",
241
+ :format => "jpg"
242
+ )
243
243
  end
244
244
 
245
245
  it "should route to zoomed picture" do
246
246
  get(
247
247
  "/pictures/3/zoom/kitten.jpg"
248
248
  ).should route_to(
249
- :controller => "alchemy/pictures",
250
- :action => "zoom",
251
- :id => "3",
252
- :name => "kitten",
253
- :format => "jpg"
254
- )
249
+ :controller => "alchemy/pictures",
250
+ :action => "zoom",
251
+ :id => "3",
252
+ :name => "kitten",
253
+ :format => "jpg"
254
+ )
255
255
  end
256
256
 
257
257
  end