mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-06 09:18:50 +01:00
Getting functional tests running.
This commit is contained in:
parent
fd433d76d8
commit
76340b780c
22 changed files with 267 additions and 216 deletions
|
|
@ -1,20 +1,16 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
|
||||
require 'preferences_controller'
|
||||
|
||||
# Re-raise errors caught by the controller.
|
||||
class PreferencesController; def rescue_action(e) raise e end; end
|
||||
|
||||
class PreferencesControllerTest < ActionController::TestCase
|
||||
fixtures :users, :preferences
|
||||
|
||||
def setup
|
||||
assert_equal "test", ENV['RAILS_ENV']
|
||||
assert_equal "test", Rails.env
|
||||
assert_equal "change-me", Tracks::Config.salt
|
||||
end
|
||||
|
||||
test "render_date_format requires login" do
|
||||
get :render_date_format
|
||||
assert_redirected_to :controller => 'login', :action => 'login'
|
||||
assert_redirected_to login_path
|
||||
end
|
||||
|
||||
test "calling render_date_format returns date" do
|
||||
|
|
@ -31,7 +27,7 @@ class PreferencesControllerTest < ActionController::TestCase
|
|||
|
||||
test "index page requires login" do
|
||||
get :index # should fail because no login
|
||||
assert_redirected_to :controller => 'login', :action => 'login'
|
||||
assert_redirected_to login_path
|
||||
end
|
||||
|
||||
test "index sets prefs and user" do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue