aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/template/atom_feed_helper_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionview/test/template/atom_feed_helper_test.rb')
-rw-r--r--actionview/test/template/atom_feed_helper_test.rb48
1 files changed, 24 insertions, 24 deletions
diff --git a/actionview/test/template/atom_feed_helper_test.rb b/actionview/test/template/atom_feed_helper_test.rb
index 591cd71404..e9a923dd72 100644
--- a/actionview/test/template/atom_feed_helper_test.rb
+++ b/actionview/test/template/atom_feed_helper_test.rb
@@ -1,4 +1,4 @@
-require 'abstract_unit'
+require "abstract_unit"
class Scroll < Struct.new(:id, :to_param, :title, :body, :updated_at, :created_at)
extend ActiveModel::Naming
@@ -28,7 +28,7 @@ class ScrollsController < ActionController::Base
end
end
EOT
- FEEDS["entry_options"] = <<-EOT
+ FEEDS["entry_options"] = <<-EOT
atom_feed do |feed|
feed.title("My great blog!")
feed.updated(@scrolls.first.created_at)
@@ -45,7 +45,7 @@ class ScrollsController < ActionController::Base
end
end
EOT
- FEEDS["entry_type_options"] = <<-EOT
+ FEEDS["entry_type_options"] = <<-EOT
atom_feed(:schema_date => '2008') do |feed|
feed.title("My great blog!")
feed.updated(@scrolls.first.created_at)
@@ -62,7 +62,7 @@ class ScrollsController < ActionController::Base
end
end
EOT
- FEEDS["entry_url_false_option"] = <<-EOT
+ FEEDS["entry_url_false_option"] = <<-EOT
atom_feed do |feed|
feed.title("My great blog!")
feed.updated(@scrolls.first.created_at)
@@ -79,7 +79,7 @@ class ScrollsController < ActionController::Base
end
end
EOT
- FEEDS["xml_block"] = <<-EOT
+ FEEDS["xml_block"] = <<-EOT
atom_feed do |feed|
feed.title("My great blog!")
feed.updated(@scrolls.first.created_at)
@@ -96,7 +96,7 @@ class ScrollsController < ActionController::Base
end
end
EOT
- FEEDS["feed_with_atomPub_namespace"] = <<-EOT
+ FEEDS["feed_with_atomPub_namespace"] = <<-EOT
atom_feed({'xmlns:app' => 'http://www.w3.org/2007/app',
'xmlns:openSearch' => 'http://a9.com/-/spec/opensearch/1.1/'}) do |feed|
feed.title("My great blog!")
@@ -115,7 +115,7 @@ class ScrollsController < ActionController::Base
end
end
EOT
- FEEDS["feed_with_overridden_ids"] = <<-EOT
+ FEEDS["feed_with_overridden_ids"] = <<-EOT
atom_feed({:id => 'tag:test.rubyonrails.org,2008:test/'}) do |feed|
feed.title("My great blog!")
feed.updated(@scrolls.first.created_at)
@@ -169,7 +169,7 @@ class ScrollsController < ActionController::Base
end
end
EOT
- FEEDS["feed_with_xhtml_content"] = <<-'EOT'
+ FEEDS["feed_with_xhtml_content"] = <<-'EOT'
atom_feed do |feed|
feed.title("My great blog!")
feed.updated(@scrolls.first.created_at)
@@ -191,7 +191,7 @@ class ScrollsController < ActionController::Base
end
end
EOT
- FEEDS["provide_builder"] = <<-'EOT'
+ FEEDS["provide_builder"] = <<-'EOT'
# we pass in the new_xml to the helper so it doesn't
# call anything on the original builder
new_xml = Builder::XmlMarkup.new(:target=>'')
@@ -217,7 +217,7 @@ class ScrollsController < ActionController::Base
Scroll.new(2, "2", "Hello Two", "Something Boring", Time.utc(2007, 12, 12, 15)),
]
- render :inline => FEEDS[params[:id]], :type => :builder
+ render inline: FEEDS[params[:id]], type: :builder
end
end
@@ -278,22 +278,22 @@ class AtomFeedTest < ActionController::TestCase
def test_feed_id_should_be_a_valid_tag
with_restful_routing(:scrolls) do
get :index, params: { id: "defaults" }
- assert_select "id", :text => "tag:www.nextangle.com,2008:/scrolls?id=defaults"
+ assert_select "id", text: "tag:www.nextangle.com,2008:/scrolls?id=defaults"
end
end
def test_entry_id_should_be_a_valid_tag
with_restful_routing(:scrolls) do
get :index, params: { id: "defaults" }
- assert_select "entry id", :text => "tag:www.nextangle.com,2008:Scroll/1"
- assert_select "entry id", :text => "tag:www.nextangle.com,2008:Scroll/2"
+ assert_select "entry id", text: "tag:www.nextangle.com,2008:Scroll/1"
+ assert_select "entry id", text: "tag:www.nextangle.com,2008:Scroll/2"
end
end
def test_feed_should_allow_nested_xml_blocks
with_restful_routing(:scrolls) do
get :index, params: { id: "xml_block" }
- assert_select "author name", :text => "DHH"
+ assert_select "author name", text: "DHH"
end
end
@@ -309,15 +309,15 @@ class AtomFeedTest < ActionController::TestCase
def test_feed_should_allow_overriding_ids
with_restful_routing(:scrolls) do
get :index, params: { id: "feed_with_overridden_ids" }
- assert_select "id", :text => "tag:test.rubyonrails.org,2008:test/"
- assert_select "entry id", :text => "tag:test.rubyonrails.org,2008:1"
- assert_select "entry id", :text => "tag:test.rubyonrails.org,2008:2"
+ assert_select "id", text: "tag:test.rubyonrails.org,2008:test/"
+ assert_select "entry id", text: "tag:test.rubyonrails.org,2008:1"
+ assert_select "entry id", text: "tag:test.rubyonrails.org,2008:2"
end
end
def test_feed_xml_processing_instructions
with_restful_routing(:scrolls) do
- get :index, params: { id: 'feed_with_xml_processing_instructions' }
+ get :index, params: { id: "feed_with_xml_processing_instructions" }
assert_match %r{<\?xml-stylesheet [^\?]*type="text/css"}, @response.body
assert_match %r{<\?xml-stylesheet [^\?]*href="t.css"}, @response.body
end
@@ -325,7 +325,7 @@ class AtomFeedTest < ActionController::TestCase
def test_feed_xml_processing_instructions_duplicate_targets
with_restful_routing(:scrolls) do
- get :index, params: { id: 'feed_with_xml_processing_instructions_duplicate_targets' }
+ get :index, params: { id: "feed_with_xml_processing_instructions_duplicate_targets" }
assert_match %r{<\?target1 (a="1" b="2"|b="2" a="1")\?>}, @response.body
assert_match %r{<\?target1 (c="3" d="4"|d="4" c="3")\?>}, @response.body
end
@@ -335,28 +335,28 @@ class AtomFeedTest < ActionController::TestCase
with_restful_routing(:scrolls) do
get :index, params: { id: "feed_with_xhtml_content" }
assert_match %r{xmlns="http://www.w3.org/1999/xhtml"}, @response.body
- assert_select "summary", :text => /Something Boring/
- assert_select "summary", :text => /after 2/
+ assert_select "summary", text: /Something Boring/
+ assert_select "summary", text: /after 2/
end
end
def test_feed_entry_type_option_default_to_text_html
with_restful_routing(:scrolls) do
- get :index, params: { id: 'defaults' }
+ get :index, params: { id: "defaults" }
assert_select "entry link[rel=alternate][type=\"text/html\"]"
end
end
def test_feed_entry_type_option_specified
with_restful_routing(:scrolls) do
- get :index, params: { id: 'entry_type_options' }
+ get :index, params: { id: "entry_type_options" }
assert_select "entry link[rel=alternate][type=\"text/xml\"]"
end
end
def test_feed_entry_url_false_option_adds_no_link
with_restful_routing(:scrolls) do
- get :index, params: { id: 'entry_url_false_option' }
+ get :index, params: { id: "entry_url_false_option" }
assert_select "entry link", false
end
end