Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: thoughtbot/clearance
...
head fork: qrush/clearance
compare: test-unit
Checking mergeability… Don’t worry, you can still create the pull request.
  • 2 commits
  • 4 files changed
  • 1 commit comment
  • 1 contributor
View
2  .travis.yml
@@ -1,7 +1,5 @@
language: ruby
rvm:
- - ree-1.8.7
- - 1.8.7
- 1.9.2
- 1.9.3
before_install:
View
5 db/schema.rb
@@ -1,3 +1,4 @@
+# encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
@@ -18,8 +19,8 @@
t.string "salt", :limit => 128
t.string "confirmation_token", :limit => 128
t.string "remember_token", :limit => 128
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
add_index "users", ["email"], :name => "index_users_on_email"
View
43 features/integration_with_test_unit.feature
@@ -0,0 +1,43 @@
+Feature: integrate with test unit
+
+ Background:
+ When I successfully run `bundle exec rails new testapp`
+ And I cd to "testapp"
+ And I remove the file "public/index.html"
+ And I remove the file "app/views/layouts/application.html.erb"
+ And I configure ActionMailer to use "localhost" as a host
+ And I configure a root route
+ And I add the "factory_girl_rails" gem
+ And I run `bundle install --local`
+
+ Scenario: generate a Rails app, run the generators, and run the tests
+ When I successfully run `bundle exec rails generate clearance:install`
+ And I successfully run `bundle exec rake db:migrate --trace`
+ And I successfully run `bundle exec rails generate controller posts index`
+ And I add the "cucumber-rails" gem
+ And I write to "test/test_helper.rb" with:
+ """
+ ENV["RAILS_ENV"] = "test"
+ require File.expand_path('../../config/environment', __FILE__)
+ require 'rails/test_help'
+
+ class ActiveSupport::TestCase
+ fixtures :all
+ end
+
+ require 'clearance/testing'
+ """
+ And I write to "test/functionals/posts_controller_test.rb" with:
+ """
+ require 'test_helper'
+
+ class PostsControllerTest < ActionController::TestCase
+ test "should get index" do
+ sign_in
+ get :index
+ assert_response :success
+ end
+ end
+ """
+ And I successfully run `bundle exec rake --trace`
+ Then the output should contain "1 tests, 1 assertions, 0 failures"
View
6 lib/clearance/testing.rb
@@ -2,9 +2,9 @@
require 'clearance/testing/deny_access_matcher'
require 'clearance/testing/helpers'
-if defined?(Test::Unit::TestCase)
- Test::Unit::TestCase.extend Clearance::Testing::Matchers
- class Test::Unit::TestCase
+if defined?(ActionController::TestCase)
+ ActionController::TestCase.extend Clearance::Testing::Matchers
+ class ActionController::TestCase
include Clearance::Testing::Helpers
end
end

Showing you all comments on commits in this comparison.

@croaky
Owner

It looks like this commit wasn't merged. @joshuaclayton, did you not want this commit when you merged the other one from @qrush? It also looks like Travis hasn't run in a few commits:

http://travis-ci.org/#!/thoughtbot/clearance

Something went wrong with that request. Please try again.