Permalink
Browse files

Fix r:site radius tags and add specs for them.

  • Loading branch information...
1 parent 8a7d8f8 commit 85205bce3fdda1b6c1dc18bcf0e8fe4676aaf6f8 @jomz jomz committed Mar 23, 2012
Showing with 26 additions and 9 deletions.
  1. +19 −9 app/models/standard_tags.rb
  2. +7 −0 spec/models/standard_tags_spec.rb
@@ -1127,15 +1127,25 @@ class RequiredAttributeError < StandardError; end
tag 'site' do |tag|
tag.expand
end
- %w(title domain dev_domain).each do |attr|
- desc %{
- Returns Radiant::Config['site.#{attr}'] as configured under the Settings tab.
- }
- tag "site:#{attr}" do |tag|
- Radiant::Config["site.#{attr}"]
- end
- end
-
+ desc %{
+ Returns Radiant::Config['site.title'] as configured under the Settings tab.
+ }
+ tag "site:title" do |tag|
+ Radiant::Config["site.title"]
+ end
+ desc %{
+ Returns Radiant::Config['site.host'] as configured under the Settings tab.
+ }
+ tag "site:host" do |tag|
+ Radiant::Config["site.host"]
+ end
+ desc %{
+ Returns Radiant::Config['dev.host'] as configured under the Settings tab.
+ }
+ tag "site:dev_host" do |tag|
+ Radiant::Config["dev.host"]
+ end
+
private
def render_children_with_pagination(tag, opts={})
if opts[:aggregate]
@@ -1098,6 +1098,13 @@
end
end
+
+ describe "Site tags" do
+ subject { page(:home) }
+ it { should render('<r:site:title />').as('Your site title')}
+ it { should render('<r:site:host />').as('www.example.com')}
+ it { should render('<r:site:dev_host />').as('')}
+ end
private

0 comments on commit 85205bc

Please sign in to comment.