Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

Commit

Permalink
Minor coding style changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
nning committed Feb 15, 2014
1 parent e56569b commit fa0c21e
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 20 deletions.
4 changes: 3 additions & 1 deletion app/helpers/versions_helper.rb
Expand Up @@ -62,7 +62,7 @@ def summarize_changes(changes)

# URL for link to object referenced by version.
def url_for_object(object)
url_for case object.class.to_s
array = case object.class.to_s
when 'Domain'
[:edit, :admin, object]
when 'Alias'
Expand All @@ -78,6 +78,8 @@ def url_for_object(object)
else
raise "No URL for object class '#{object.class.to_s}'."
end

url_for array
end

# Convert changes YAML to hash just containing the new values.
Expand Down
2 changes: 1 addition & 1 deletion app/models/domain.rb
Expand Up @@ -18,7 +18,7 @@ class Domain < ActiveRecord::Base

has_paper_trail

before_save ->{ name.downcase! }
before_save -> { name.downcase! }

# Aliases count for simple_form.
def aliases_count
Expand Down
6 changes: 3 additions & 3 deletions test/functional/admin/aliases_controller_test.rb
Expand Up @@ -36,7 +36,7 @@ class Admin::AliasesControllerTest < ActionController::TestCase
end

should respond_with :redirect
should set_the_flash.to /created/i
should set_the_flash.to(/created/i)
end

context 'to update' do
Expand All @@ -59,7 +59,7 @@ class Admin::AliasesControllerTest < ActionController::TestCase
end

should respond_with :redirect
should set_the_flash.to /successfully updated/i
should set_the_flash.to(/successfully updated/i)
end
end

Expand All @@ -74,7 +74,7 @@ class Admin::AliasesControllerTest < ActionController::TestCase
end

should respond_with :redirect
should set_the_flash.to /successfully destroyed/i
should set_the_flash.to(/successfully destroyed/i)
end
end
end
Expand Down
18 changes: 9 additions & 9 deletions test/functional/admin/mailboxes_controller_test.rb
Expand Up @@ -58,7 +58,7 @@ class Admin::MailboxesControllerTest < ActionController::TestCase
end
end

should respond_with(:redirect)
should respond_with :redirect
should set_the_flash.to(/created/i)
end

Expand All @@ -80,7 +80,7 @@ class Admin::MailboxesControllerTest < ActionController::TestCase
assert !Mailbox.where(username: @mailbox.username, domain_id: @domain_id).first
end

should respond_with(:redirect)
should respond_with :redirect
should set_the_flash.to(/successfully updated/i)
end
end
Expand All @@ -95,7 +95,7 @@ class Admin::MailboxesControllerTest < ActionController::TestCase
assert !Mailbox.where(username: @mailbox.username, domain_id: @mailbox.domain_id).first
end

should respond_with(:redirect)
should respond_with :redirect
should set_the_flash.to(/successfully destroyed/i)
end
end
Expand Down Expand Up @@ -145,7 +145,7 @@ class Admin::MailboxesControllerTest < ActionController::TestCase
assert Mailbox.where(username: @new_mailbox.username, domain_id: @domain_id).first
end

should respond_with(:redirect)
should respond_with :redirect
should set_the_flash.to(/created/i)
end

Expand All @@ -165,7 +165,7 @@ class Admin::MailboxesControllerTest < ActionController::TestCase
assert !Mailbox.where(username: @new_mailbox.username, domain_id: @domain_id).first
end

should respond_with(:redirect)
should respond_with :redirect
should set_the_flash.to(/successfully updated/i)
end
end
Expand All @@ -180,7 +180,7 @@ class Admin::MailboxesControllerTest < ActionController::TestCase
assert !Mailbox.where(username: @new_mailbox.username, domain_id: @domain_id).first
end

should respond_with(:redirect)
should respond_with :redirect
should set_the_flash.to(/successfully destroyed/i)
end
end
Expand Down Expand Up @@ -224,7 +224,7 @@ class Admin::MailboxesControllerTest < ActionController::TestCase
assert Mailbox.where(username: @new_mailbox.username, domain_id: @domain_id).first
end

should respond_with(:redirect)
should respond_with :redirect
should set_the_flash.to(/created/i)
end

Expand All @@ -244,7 +244,7 @@ class Admin::MailboxesControllerTest < ActionController::TestCase
assert !Mailbox.where(username: @new_mailbox.username, domain_id: @domain_id).first
end

should respond_with(:redirect)
should respond_with :redirect
should set_the_flash.to(/successfully updated/i)
end
end
Expand All @@ -259,7 +259,7 @@ class Admin::MailboxesControllerTest < ActionController::TestCase
assert !Mailbox.where(username: @new_mailbox.username, domain_id: @domain_id).first
end

should respond_with(:redirect)
should respond_with :redirect
should set_the_flash.to(/successfully destroyed/i)
end
end
Expand Down
12 changes: 6 additions & 6 deletions test/functional/admin/permissions_controller_test.rb
Expand Up @@ -49,7 +49,7 @@ def delete_to_destroy
.first
end

should respond_with(:redirect)
should respond_with :redirect
should set_the_flash.to(/created/i)
end

Expand Down Expand Up @@ -77,7 +77,7 @@ def delete_to_destroy
.first
end

should respond_with(:redirect)
should respond_with :redirect
should set_the_flash.to(/successfully updated/i)
end
end
Expand All @@ -95,7 +95,7 @@ def delete_to_destroy
.first
end

should respond_with(:redirect)
should respond_with :redirect
should set_the_flash.to(/successfully destroyed/i)
end
end
Expand Down Expand Up @@ -141,7 +141,7 @@ def delete_to_destroy
.first
end

should respond_with(:redirect)
should respond_with :redirect
should set_the_flash.to(/created/i)
end

Expand Down Expand Up @@ -169,7 +169,7 @@ def delete_to_destroy
.first
end

should respond_with(:redirect)
should respond_with :redirect
should set_the_flash.to(/successfully updated/i)
end
end
Expand All @@ -187,7 +187,7 @@ def delete_to_destroy
.first
end

should respond_with(:redirect)
should respond_with :redirect
should set_the_flash.to(/successfully destroyed/i)
end
end
Expand Down
1 change: 1 addition & 0 deletions test/functional/admin/test_helper.rb
@@ -1,3 +1,4 @@
# Create a dummy Mailbox and sign it in.
def create_and_sign_in_mailbox
@mailbox = FactoryGirl.create :mailbox, admin: true
@domain_id = @mailbox.domain_id
Expand Down

0 comments on commit fa0c21e

Please sign in to comment.