Skip to content
Permalink
Browse files
Merge branch 'minitest_cleanup'
  • Loading branch information
rafaelfranca committed Dec 31, 2012
2 parents 5e51074 + cf4afc4 commit b22c527e65a41da59dbfcb078968069c6fae5086
Show file tree
Hide file tree
Showing 57 changed files with 147 additions and 718 deletions.
@@ -10,13 +10,6 @@ def initialize(name)
end

class TestCase < ActiveSupport::TestCase

# Use AM::TestCase for the base class when describing a mailer
register_spec_type(self) do |desc|
Class === desc && desc < ActionMailer::Base
end
register_spec_type(/Mailer( ?Test)?\z/i, self)

module Behavior
extend ActiveSupport::Concern

@@ -8,7 +8,7 @@
Encoding.default_external = "UTF-8"
end

require 'minitest/autorun'
require 'active_support/testing/autorun'
require 'action_mailer'
require 'action_mailer/test_case'

This file was deleted.

@@ -26,147 +26,3 @@ def test_set_mailer_class_manual_using_string
assert_equal TestTestMailer, self.class.mailer_class
end
end

describe TestTestMailer do
it "gets the mailer from the test name" do
assert_equal TestTestMailer, self.class.mailer_class
end
end

describe TestTestMailer, :action do
it "gets the mailer from the test name" do
assert_equal TestTestMailer, self.class.mailer_class
end
end

describe TestTestMailer do
describe "nested" do
it "gets the mailer from the test name" do
assert_equal TestTestMailer, self.class.mailer_class
end
end
end

describe TestTestMailer, :action do
describe "nested" do
it "gets the mailer from the test name" do
assert_equal TestTestMailer, self.class.mailer_class
end
end
end

describe "TestTestMailer" do
it "gets the mailer from the test name" do
assert_equal TestTestMailer, self.class.mailer_class
end
end

describe "TestTestMailerTest" do
it "gets the mailer from the test name" do
assert_equal TestTestMailer, self.class.mailer_class
end
end

describe "TestTestMailer" do
describe "nested" do
it "gets the mailer from the test name" do
assert_equal TestTestMailer, self.class.mailer_class
end
end
end

describe "TestTestMailerTest" do
describe "nested" do
it "gets the mailer from the test name" do
assert_equal TestTestMailer, self.class.mailer_class
end
end
end

describe "AnotherCrazySymbolNameMailerTest" do
tests :test_test_mailer

it "gets the mailer after setting it with a symbol" do
assert_equal TestTestMailer, self.class.mailer_class
end
end

describe "AnotherCrazyStringNameMailerTest" do
tests 'test_test_mailer'

it "gets the mailer after setting it with a string" do
assert_equal TestTestMailer, self.class.mailer_class
end
end

describe "Another Crazy Name Mailer Test" do
tests TestTestMailer

it "gets the mailer after setting it manually" do
assert_equal TestTestMailer, self.class.mailer_class
end
end

describe "Another Crazy Symbol Name Mailer Test" do
tests :test_test_mailer

it "gets the mailer after setting it with a symbol" do
assert_equal TestTestMailer, self.class.mailer_class
end
end

describe "Another Crazy String Name Mailer Test" do
tests 'test_test_mailer'

it "gets the mailer after setting it with a string" do
assert_equal TestTestMailer, self.class.mailer_class
end
end

describe "AnotherCrazySymbolNameMailerTest" do
tests :test_test_mailer

describe "nested" do
it "gets the mailer after setting it with a symbol" do
assert_equal TestTestMailer, self.class.mailer_class
end
end
end

describe "AnotherCrazyStringNameMailerTest" do
tests 'test_test_mailer'

describe "nested" do
it "gets the mailer after setting it with a string" do
assert_equal TestTestMailer, self.class.mailer_class
end
end
end

describe "Another Crazy Name Mailer Test" do
tests TestTestMailer

describe "nested" do
it "gets the mailer after setting it manually" do
assert_equal TestTestMailer, self.class.mailer_class
end
end
end

describe "Another Crazy Symbol Name Mailer Test" do
tests :test_test_mailer

describe "nested" do
it "gets the mailer after setting it with a symbol" do
assert_equal TestTestMailer, self.class.mailer_class
end
end
end

describe "Another Crazy String Name Mailer Test" do
tests 'test_test_mailer'

it "gets the mailer after setting it with a string" do
assert_equal TestTestMailer, self.class.mailer_class
end
end
@@ -360,13 +360,6 @@ def exists?
#
# assert_redirected_to page_url(title: 'foo')
class TestCase < ActiveSupport::TestCase

# Use AC::TestCase for the base class when describing a controller
register_spec_type(self) do |desc|
Class === desc && desc < ActionController::Metal
end
register_spec_type(/Controller( ?Test)?\z/i, self)

module Behavior
extend ActiveSupport::Concern
include ActionDispatch::TestProcess
@@ -20,7 +20,7 @@ def assert_dom_equal(expected, actual, message = "")
def assert_dom_not_equal(expected, actual, message = "")
expected_dom = HTML::Document.new(expected).root
actual_dom = HTML::Document.new(actual).root
refute_equal expected_dom, actual_dom
assert_not_equal expected_dom, actual_dom
end
end
end
@@ -491,9 +491,6 @@ class IntegrationTest < ActiveSupport::TestCase
include ActionController::TemplateAssertions
include ActionDispatch::Routing::UrlFor

# Use AD::IntegrationTest for acceptance tests
register_spec_type(/(Acceptance|Integration) ?Test\z/i, self)

@@app = nil

def self.app
@@ -30,9 +30,6 @@ def initialize
end
end

# Use AV::TestCase for the base class for helpers and views
register_spec_type(/(Helper|View)( ?Test)?\z/i, self)

module Behavior
extend ActiveSupport::Concern

@@ -15,7 +15,7 @@
Encoding.default_external = "UTF-8"
end

require 'minitest/autorun'
require 'active_support/testing/autorun'
require 'abstract_controller'
require 'action_controller'
require 'action_view'
@@ -111,21 +111,21 @@ def authenticate_long_credentials
assert_equal(expected, actual)
end

test "token_and_options returns correct token" do
test "token_and_options returns correct token with value after the equal sign" do
token = 'rcHu+=HzSFw89Ypyhn/896A==f34'
actual = ActionController::HttpAuthentication::Token.token_and_options(sample_request(token)).first
expected = token
assert_equal(expected, actual)
end

test "token_and_options returns correct token" do
test "token_and_options returns correct token with slashes" do
token = 'rcHu+\\\\"/896A'
actual = ActionController::HttpAuthentication::Token.token_and_options(sample_request(token)).first
expected = token
assert_equal(expected, actual)
end

test "token_and_options returns correct token" do
test "token_and_options returns correct token with quotes" do
token = '\"quote\" pretty'
actual = ActionController::HttpAuthentication::Token.token_and_options(sample_request(token)).first
expected = token
@@ -40,7 +40,7 @@ def blocking_stream

def thread_locals
tc.assert_equal 'aaron', Thread.current[:setting]
tc.refute_equal Thread.current.object_id, Thread.current[:originating_thread]
tc.assert_not_equal Thread.current.object_id, Thread.current[:originating_thread]

response.headers['Content-Type'] = 'text/event-stream'
%w{ hello world }.each do |word|

1 comment on commit b22c527

@metaskills
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For anyone that does not like this. I will make sure minitest-spec-rails works just as cleanly on Rails 4.x.

Please sign in to comment.