secret
Created

  • Download Gist
Gemfile
Ruby
1 2 3 4 5 6 7 8 9 10 11 12
group :test do
gem 'miniskirt', require: false
gem 'faker'
gem 'minitest'
gem 'minitest-wscolor'
gem 'rack-test', require: false
gem 'mocha', require: false
gem 'capybara', require: false
# gem 'show_me_the_cookies'
gem 'simplecov', require: false
gem 'm', require: false
end
client_test.rb
Ruby
1 2 3 4 5 6 7 8 9
require 'test_helper'
 
class TestClient < CheddarTest
def test_that_it_authenticates
client = Factory.create(:client)
assert_equal Client.authenticate(client.client_id, client.client_secret), client
refute_equal Client.authenticate(client.client_id, client.client_id), client
end
end
test_helper.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
require 'simplecov'
SimpleCov.start 'rails'
 
ENV['RAILS_ENV'] = 'test'
require File.expand_path('../../config/environment', __FILE__)
 
require 'rubygems'
gem 'minitest'
require 'minitest/autorun'
require 'action_controller/test_case'
 
require 'miniskirt'
require 'capybara/rails'
require 'mocha'
 
# Support files
Dir["#{File.expand_path(File.dirname(__FILE__))}/support/*.rb"].each do |file|
require file
end
 
class CheddarTest < MiniTest::Unit::TestCase
include ActiveSupport::Testing::SetupAndTeardown
include Rails.application.routes.url_helpers
include MailerMacros
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.