Commit 04094b6f by Prem Sichanugrist

Cleanup whitespaces

parent 5a138fd9
......@@ -181,7 +181,7 @@ Then /^the "([^"]*)" checkbox(?: within (.*))? should not be checked$/ do |label
end
end
end
Then /^(?:|I )should be on (.+)$/ do |page_name|
current_path = URI.parse(current_url).path
if current_path.respond_to? :should
......@@ -195,8 +195,8 @@ Then /^(?:|I )should have the following query string:$/ do |expected_pairs|
query = URI.parse(current_url).query
actual_params = query ? CGI.parse(query) : {}
expected_params = {}
expected_pairs.rows_hash.each_pair{|k,v| expected_params[k] = v.split(',')}
expected_pairs.rows_hash.each_pair{|k,v| expected_params[k] = v.split(',')}
if actual_params.respond_to? :should
actual_params.should == expected_params
else
......
......@@ -41,7 +41,7 @@ module Paperclip
#
# class ActiveSupport::TestCase
# extend Paperclip::Shoulda::Matchers
#
#
# #...other initializers...#
# end
#
......@@ -57,7 +57,7 @@ module Paperclip
# should validate_attachment_size(:avatar).
# less_than(2.megabytes)
# end
#
#
module Matchers
end
end
......
......@@ -51,7 +51,7 @@ module Paperclip
end
protected
def accepted_types_and_failures
if @allowed_types.present?
"Accept content types: #{@allowed_types.join(", ")}\n".tap do |message|
......@@ -61,7 +61,7 @@ module Paperclip
message << " All were accepted successfully."
end
end
end
end
end
def rejected_types_and_failures
if @rejected_types.present?
......@@ -74,10 +74,10 @@ module Paperclip
end
end
end
def expected_attachment
"Expected #{@attachment_name}:\n"
end
end
def type_allowed?(type)
@subject.send("#{@attachment_name}_content_type=", type)
......
......@@ -197,7 +197,7 @@ module Paperclip
else
@options[:fog_directory]
end
@directory ||= connection.directories.new(:key => dir)
end
end
......
......@@ -61,7 +61,7 @@ module Paperclip
# Normally, this won't matter in the slightest and you can leave the default (which is
# path-style, or :s3_path_url). But in some cases paths don't work and you need to use
# the domain-style (:s3_domain_url). Anything else here will be treated like path-style.
#
#
# Notes:
# * The value of this option is a string, not a symbol.
# <b>right:</b> <tt>":s3_domain_url"</tt>
......
......@@ -52,12 +52,12 @@ module Paperclip
end
def convert_options
@convert_options.respond_to?(:call) ? @convert_options.call(attachment.instance) :
@convert_options.respond_to?(:call) ? @convert_options.call(attachment.instance) :
(@convert_options || attachment.send(:extra_options_for, name))
end
def source_file_options
@source_file_options.respond_to?(:call) ? @source_file_options.call(attachment.instance) :
@source_file_options.respond_to?(:call) ? @source_file_options.call(attachment.instance) :
(@source_file_options || attachment.send(:extra_source_file_options_for, name))
end
......
......@@ -744,7 +744,7 @@ class AttachmentTest < Test::Unit::TestCase
rebuild_model
@file = Tempfile.new(["filename","png"])
end
teardown do
@file.unlink
end
......@@ -752,7 +752,7 @@ class AttachmentTest < Test::Unit::TestCase
context "with default configuration" do
"&$+,/:;=?@<>[]{}|\^~%# ".split(//).each do |character|
context "with character #{character}" do
context "at beginning of filename" do
setup do
@file.stubs(:original_filename).returns("#{character}filename.png")
......@@ -762,9 +762,9 @@ class AttachmentTest < Test::Unit::TestCase
should "convert special character into underscore" do
assert_equal "_filename.png", @dummy.avatar.original_filename
end
end
end
context "at end of filename" do
setup do
@file.stubs(:original_filename).returns("filename.png#{character}")
......@@ -776,7 +776,7 @@ class AttachmentTest < Test::Unit::TestCase
assert_equal "filename.png_", @dummy.avatar.original_filename
end
end
context "in the middle of filename" do
setup do
@file.stubs(:original_filename).returns("file#{character}name.png")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment