radiant 0.7.0 → 0.7.1
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.
Potentially problematic release.
This version of radiant might be problematic. Click here for more details.
- data/CHANGELOG +5 -0
 - data/CONTRIBUTORS +5 -0
 - data/app/helpers/admin/references_helper.rb +1 -1
 - data/app/views/admin/page_parts/_page_part.html.haml +1 -1
 - data/lib/radiant.rb +1 -1
 - data/lib/tasks/release.rake +13 -4
 - data/spec/helpers/admin/references_helper_spec.rb +115 -0
 - data/spec/integration/admin/pages_integration_spec.rb +6 -0
 - metadata +5 -2
 
    
        data/CHANGELOG
    CHANGED
    
    | 
         @@ -1,5 +1,10 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            == Change Log
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
      
 3 
     | 
    
         
            +
            === 0.7.1 Engraving
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            * Properly escape page part contents in the UI. [John Muhl, Sean Cribbs]
         
     | 
| 
      
 6 
     | 
    
         
            +
            * Fix tag reference popup and spec out helper better. [Sean Cribbs]
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
       3 
8 
     | 
    
         
             
            === 0.7.0 Intaglio
         
     | 
| 
       4 
9 
     | 
    
         
             
            * Add Roasters template. [Paul du Coudray]
         
     | 
| 
       5 
10 
     | 
    
         
             
            * Make ResponseCache spec insensitive to key order. [Sean Cribbs]
         
     | 
    
        data/CONTRIBUTORS
    CHANGED
    
    
| 
         @@ -12,4 +12,4 @@ 
     | 
|
| 
       12 
12 
     | 
    
         
             
                      = link_to_function 'Available Tags', "load_tag_reference('#{page_part.name.to_slug}');"
         
     | 
| 
       13 
13 
     | 
    
         
             
                  = render_region :part_controls, :locals => {:page_part => page_part}
         
     | 
| 
       14 
14 
     | 
    
         
             
                %div
         
     | 
| 
       15 
     | 
    
         
            -
                  ~ text_area_tag 'page[parts][][content]', page_part.content, :class => "textarea", :style => "width: 100%", :id => "part_#{page_part.name.to_slug}_content"
         
     | 
| 
      
 15 
     | 
    
         
            +
                  ~ text_area_tag 'page[parts][][content]', h(page_part.content), :class => "textarea", :style => "width: 100%", :id => "part_#{page_part.name.to_slug}_content"
         
     | 
    
        data/lib/radiant.rb
    CHANGED
    
    
    
        data/lib/tasks/release.rake
    CHANGED
    
    | 
         @@ -91,13 +91,22 @@ namespace 'radiant' do 
     | 
|
| 
       91 
91 
     | 
    
         
             
              desc "Publish the release files to RubyForge."
         
     | 
| 
       92 
92 
     | 
    
         
             
              task :release => [:gem, :package] do
         
     | 
| 
       93 
93 
     | 
    
         
             
                files = ["gem", "tgz", "zip"].map { |ext| "pkg/#{PKG_FILE_NAME}.#{ext}" }
         
     | 
| 
       94 
     | 
    
         
            -
             
     | 
| 
       95 
     | 
    
         
            -
                system %{rubyforge login 
     | 
| 
      
 94 
     | 
    
         
            +
                release_id = nil
         
     | 
| 
      
 95 
     | 
    
         
            +
                system %{rubyforge login}
         
     | 
| 
       96 
96 
     | 
    
         
             
                files.each_with_index do |file, idx|
         
     | 
| 
       97 
97 
     | 
    
         
             
                  if idx == 0
         
     | 
| 
       98 
     | 
    
         
            -
                     
     | 
| 
      
 98 
     | 
    
         
            +
                    cmd = %Q[rubyforge add_release #{RELEASE_NOTES}#{RELEASE_CHANGES} --preformatted #{RUBY_FORGE_GROUPID} #{RUBY_FORGE_PACKAGEID} "#{RELEASE_NAME}" #{file}]
         
     | 
| 
      
 99 
     | 
    
         
            +
                    puts cmd
         
     | 
| 
      
 100 
     | 
    
         
            +
                    system cmd
         
     | 
| 
       99 
101 
     | 
    
         
             
                  else
         
     | 
| 
       100 
     | 
    
         
            -
                     
     | 
| 
      
 102 
     | 
    
         
            +
                    release_id ||= begin
         
     | 
| 
      
 103 
     | 
    
         
            +
                      puts "rubyforge config #{RUBY_FORGE_PROJECT}"
         
     | 
| 
      
 104 
     | 
    
         
            +
                      system "rubyforge config #{RUBY_FORGE_PROJECT}"
         
     | 
| 
      
 105 
     | 
    
         
            +
                      `cat ~/.rubyforge/auto-config.yml | grep "#{RELEASE_NAME}"`.strip.split(/:/).last.strip
         
     | 
| 
      
 106 
     | 
    
         
            +
                    end
         
     | 
| 
      
 107 
     | 
    
         
            +
                    cmd = %Q[rubyforge add_file #{RUBY_FORGE_GROUPID} #{RUBY_FORGE_PACKAGEID} #{release_id} #{file}]
         
     | 
| 
      
 108 
     | 
    
         
            +
                    puts cmd
         
     | 
| 
      
 109 
     | 
    
         
            +
                    system cmd
         
     | 
| 
       101 
110 
     | 
    
         
             
                  end
         
     | 
| 
       102 
111 
     | 
    
         
             
                end
         
     | 
| 
       103 
112 
     | 
    
         
             
              end
         
     | 
| 
         @@ -0,0 +1,115 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require File.dirname(__FILE__) + '/../../spec_helper'
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            describe Admin::ReferencesHelper do
         
     | 
| 
      
 4 
     | 
    
         
            +
              describe "determining the page class" do
         
     | 
| 
      
 5 
     | 
    
         
            +
                before :each do
         
     | 
| 
      
 6 
     | 
    
         
            +
                  helper.send(:instance_variable_set, :@page_class, nil)
         
     | 
| 
      
 7 
     | 
    
         
            +
                end
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
                it "should return Page when the class_name was not sent" do
         
     | 
| 
      
 10 
     | 
    
         
            +
                  helper.class_of_page.should == Page
         
     | 
| 
      
 11 
     | 
    
         
            +
                end
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
                it "should return the named class when sent class_name" do
         
     | 
| 
      
 14 
     | 
    
         
            +
                  params[:class_name] = "FileNotFoundPage"
         
     | 
| 
      
 15 
     | 
    
         
            +
                  helper.class_of_page.should == FileNotFoundPage
         
     | 
| 
      
 16 
     | 
    
         
            +
                end
         
     | 
| 
      
 17 
     | 
    
         
            +
             
     | 
| 
      
 18 
     | 
    
         
            +
                it "should return Page when the class_name is blank" do
         
     | 
| 
      
 19 
     | 
    
         
            +
                  params[:class_name] = ''
         
     | 
| 
      
 20 
     | 
    
         
            +
                  helper.class_of_page.should == Page
         
     | 
| 
      
 21 
     | 
    
         
            +
                end
         
     | 
| 
      
 22 
     | 
    
         
            +
              end
         
     | 
| 
      
 23 
     | 
    
         
            +
             
     | 
| 
      
 24 
     | 
    
         
            +
              describe "determining the filter" do
         
     | 
| 
      
 25 
     | 
    
         
            +
                before :each do
         
     | 
| 
      
 26 
     | 
    
         
            +
                  helper.send(:instance_variable_set, :@filter, nil)
         
     | 
| 
      
 27 
     | 
    
         
            +
                end
         
     | 
| 
      
 28 
     | 
    
         
            +
             
     | 
| 
      
 29 
     | 
    
         
            +
                it "should return nil when no filter is set" do
         
     | 
| 
      
 30 
     | 
    
         
            +
                  helper.filter.should be_nil
         
     | 
| 
      
 31 
     | 
    
         
            +
                end
         
     | 
| 
      
 32 
     | 
    
         
            +
             
     | 
| 
      
 33 
     | 
    
         
            +
                it "should return the filter object for the named filter" do
         
     | 
| 
      
 34 
     | 
    
         
            +
                  params[:filter_name] = "Textile"
         
     | 
| 
      
 35 
     | 
    
         
            +
                  helper.filter.should == TextileFilter
         
     | 
| 
      
 36 
     | 
    
         
            +
                end
         
     | 
| 
      
 37 
     | 
    
         
            +
             
     | 
| 
      
 38 
     | 
    
         
            +
                it "should return nil when the set filter is blank" do
         
     | 
| 
      
 39 
     | 
    
         
            +
                  params[:filter_name] = ' '
         
     | 
| 
      
 40 
     | 
    
         
            +
                  helper.filter.should be_nil
         
     | 
| 
      
 41 
     | 
    
         
            +
                end
         
     | 
| 
      
 42 
     | 
    
         
            +
              end
         
     | 
| 
      
 43 
     | 
    
         
            +
             
     | 
| 
      
 44 
     | 
    
         
            +
              describe "determining the display name" do
         
     | 
| 
      
 45 
     | 
    
         
            +
                describe "when getting a filter reference" do
         
     | 
| 
      
 46 
     | 
    
         
            +
                  before :each do
         
     | 
| 
      
 47 
     | 
    
         
            +
                    helper.send(:instance_variable_set, :@filter, nil)
         
     | 
| 
      
 48 
     | 
    
         
            +
                    params[:id] = 'filters'
         
     | 
| 
      
 49 
     | 
    
         
            +
                  end
         
     | 
| 
      
 50 
     | 
    
         
            +
             
     | 
| 
      
 51 
     | 
    
         
            +
                  it "should return the name of the set filter" do
         
     | 
| 
      
 52 
     | 
    
         
            +
                    params[:filter_name] = "Textile"
         
     | 
| 
      
 53 
     | 
    
         
            +
                    helper._display_name.should == "Textile"
         
     | 
| 
      
 54 
     | 
    
         
            +
                  end
         
     | 
| 
      
 55 
     | 
    
         
            +
             
     | 
| 
      
 56 
     | 
    
         
            +
                  it "should return <none> when no filter is set" do
         
     | 
| 
      
 57 
     | 
    
         
            +
                    params[:filter_name] = nil
         
     | 
| 
      
 58 
     | 
    
         
            +
                    helper._display_name.should == "<none>"
         
     | 
| 
      
 59 
     | 
    
         
            +
                  end
         
     | 
| 
      
 60 
     | 
    
         
            +
                end
         
     | 
| 
      
 61 
     | 
    
         
            +
             
     | 
| 
      
 62 
     | 
    
         
            +
                describe "when getting a tag reference" do
         
     | 
| 
      
 63 
     | 
    
         
            +
                  before :each do
         
     | 
| 
      
 64 
     | 
    
         
            +
                    helper.send(:instance_variable_set, :@page_class, nil)
         
     | 
| 
      
 65 
     | 
    
         
            +
                    params[:id] = 'tags'
         
     | 
| 
      
 66 
     | 
    
         
            +
                  end
         
     | 
| 
      
 67 
     | 
    
         
            +
             
     | 
| 
      
 68 
     | 
    
         
            +
                  it "should return the display name of the page class" do
         
     | 
| 
      
 69 
     | 
    
         
            +
                    params[:class_name] = "FileNotFoundPage"
         
     | 
| 
      
 70 
     | 
    
         
            +
                    helper._display_name.should == "File Not Found"
         
     | 
| 
      
 71 
     | 
    
         
            +
                  end
         
     | 
| 
      
 72 
     | 
    
         
            +
             
     | 
| 
      
 73 
     | 
    
         
            +
                  it "should return Page when <normal> is chosen" do
         
     | 
| 
      
 74 
     | 
    
         
            +
                    params[:class_name] = nil
         
     | 
| 
      
 75 
     | 
    
         
            +
                    helper._display_name.should == "Page"
         
     | 
| 
      
 76 
     | 
    
         
            +
                  end
         
     | 
| 
      
 77 
     | 
    
         
            +
                end
         
     | 
| 
      
 78 
     | 
    
         
            +
              end
         
     | 
| 
      
 79 
     | 
    
         
            +
             
     | 
| 
      
 80 
     | 
    
         
            +
              describe "rendering the filter reference" do
         
     | 
| 
      
 81 
     | 
    
         
            +
                before :each do
         
     | 
| 
      
 82 
     | 
    
         
            +
                  helper.send(:instance_variable_set, :@filter, nil)
         
     | 
| 
      
 83 
     | 
    
         
            +
                  params[:id] = 'filters'
         
     | 
| 
      
 84 
     | 
    
         
            +
                  params[:filter_name] = 'Textile'
         
     | 
| 
      
 85 
     | 
    
         
            +
                end
         
     | 
| 
      
 86 
     | 
    
         
            +
             
     | 
| 
      
 87 
     | 
    
         
            +
                it "should render a helpful message when the description is blank" do
         
     | 
| 
      
 88 
     | 
    
         
            +
                  TextileFilter.should_receive(:description).and_return('')
         
     | 
| 
      
 89 
     | 
    
         
            +
                  helper.filter_reference.should == "There is no documentation on this filter."
         
     | 
| 
      
 90 
     | 
    
         
            +
                end
         
     | 
| 
      
 91 
     | 
    
         
            +
             
     | 
| 
      
 92 
     | 
    
         
            +
                it "should render the filter's description when available" do
         
     | 
| 
      
 93 
     | 
    
         
            +
                  helper.filter_reference.should == TextileFilter.description
         
     | 
| 
      
 94 
     | 
    
         
            +
                end
         
     | 
| 
      
 95 
     | 
    
         
            +
             
     | 
| 
      
 96 
     | 
    
         
            +
                it "should render a helpful message when no filter is selected" do
         
     | 
| 
      
 97 
     | 
    
         
            +
                  params[:filter_name] = nil
         
     | 
| 
      
 98 
     | 
    
         
            +
                  helper.filter_reference.should == "There is no filter on the current page part."
         
     | 
| 
      
 99 
     | 
    
         
            +
                end
         
     | 
| 
      
 100 
     | 
    
         
            +
              end
         
     | 
| 
      
 101 
     | 
    
         
            +
             
     | 
| 
      
 102 
     | 
    
         
            +
              describe "rendering the tag reference" do
         
     | 
| 
      
 103 
     | 
    
         
            +
                before :each do
         
     | 
| 
      
 104 
     | 
    
         
            +
                  helper.send(:instance_variable_set, :@page_class, nil)
         
     | 
| 
      
 105 
     | 
    
         
            +
                  params[:id] = 'tags'
         
     | 
| 
      
 106 
     | 
    
         
            +
                  params[:class_name] = ''
         
     | 
| 
      
 107 
     | 
    
         
            +
                end
         
     | 
| 
      
 108 
     | 
    
         
            +
             
     | 
| 
      
 109 
     | 
    
         
            +
                it "should render the tag reference partial for each tag description" do
         
     | 
| 
      
 110 
     | 
    
         
            +
                  count = Page.tag_descriptions.size
         
     | 
| 
      
 111 
     | 
    
         
            +
                  helper.should_receive(:render).exactly(count).times.and_return("desc")
         
     | 
| 
      
 112 
     | 
    
         
            +
                  helper.tag_reference.should == "desc" * count
         
     | 
| 
      
 113 
     | 
    
         
            +
                end
         
     | 
| 
      
 114 
     | 
    
         
            +
              end
         
     | 
| 
      
 115 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -34,6 +34,12 @@ describe 'Page management' do 
     | 
|
| 
       34 
34 
     | 
    
         
             
                response.should have_text(/Under Construction/)
         
     | 
| 
       35 
35 
     | 
    
         
             
              end
         
     | 
| 
       36 
36 
     | 
    
         | 
| 
      
 37 
     | 
    
         
            +
              it "should properly escape part contents" do
         
     | 
| 
      
 38 
     | 
    
         
            +
                navigate_to '/admin/pages/new'
         
     | 
| 
      
 39 
     | 
    
         
            +
                submit_form 'new_page', :continue => 'Save and Continue', :page => {:title => 'My Site', :slug => '/', :breadcrumb => 'My Site', :parts => [{:name => 'body', :content => '<r:url />'}], :status_id => Status[:published].id}
         
     | 
| 
      
 40 
     | 
    
         
            +
                response.should have_tag('textarea', :text => "&lt;r:url /&gt;")
         
     | 
| 
      
 41 
     | 
    
         
            +
              end
         
     | 
| 
      
 42 
     | 
    
         
            +
              
         
     | 
| 
       37 
43 
     | 
    
         
             
              describe 'with homepage' do
         
     | 
| 
       38 
44 
     | 
    
         
             
                dataset :home_page
         
     | 
| 
       39 
45 
     | 
    
         | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification 
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: radiant
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version 
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.7. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.7.1
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors: 
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Radiant CMS dev team
         
     | 
| 
         @@ -9,7 +9,7 @@ autorequire: 
     | 
|
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
11 
     | 
    
         | 
| 
       12 
     | 
    
         
            -
            date: 2009-02- 
     | 
| 
      
 12 
     | 
    
         
            +
            date: 2009-02-15 00:00:00 -05:00
         
     | 
| 
       13 
13 
     | 
    
         
             
            default_executable: 
         
     | 
| 
       14 
14 
     | 
    
         
             
            dependencies: 
         
     | 
| 
       15 
15 
     | 
    
         
             
            - !ruby/object:Gem::Dependency 
         
     | 
| 
         @@ -447,6 +447,7 @@ files: 
     | 
|
| 
       447 
447 
     | 
    
         
             
            - spec/helpers/admin/node_helper_spec.rb
         
     | 
| 
       448 
448 
     | 
    
         
             
            - spec/helpers/admin/pages_helper_spec.rb
         
     | 
| 
       449 
449 
     | 
    
         
             
            - spec/helpers/admin/preferences_helper_spec.rb
         
     | 
| 
      
 450 
     | 
    
         
            +
            - spec/helpers/admin/references_helper_spec.rb
         
     | 
| 
       450 
451 
     | 
    
         
             
            - spec/helpers/admin/regions_helper_spec.rb
         
     | 
| 
       451 
452 
     | 
    
         
             
            - spec/helpers/admin/snippets_helper_spec.rb
         
     | 
| 
       452 
453 
     | 
    
         
             
            - spec/helpers/admin/users_helper_spec.rb
         
     | 
| 
         @@ -2596,6 +2597,8 @@ rdoc_options: 
     | 
|
| 
       2596 
2597 
     | 
    
         
             
            - --exclude
         
     | 
| 
       2597 
2598 
     | 
    
         
             
            - log
         
     | 
| 
       2598 
2599 
     | 
    
         
             
            - --exclude
         
     | 
| 
      
 2600 
     | 
    
         
            +
            - pkg
         
     | 
| 
      
 2601 
     | 
    
         
            +
            - --exclude
         
     | 
| 
       2599 
2602 
     | 
    
         
             
            - public
         
     | 
| 
       2600 
2603 
     | 
    
         
             
            - --exclude
         
     | 
| 
       2601 
2604 
     | 
    
         
             
            - script
         
     |