|
Revision 92, 0.9 KB
(checked in by dema, 6 years ago)
|
|
Fixed application start-up sequence. Closes #56. Also, the app now hides the meta-toolbar when in production mode (for that, start the server with 'script/server -e production').
|
| Rev | Line | |
|---|
| [92] | 1 | require "#{File.dirname(__FILE__)}/../test_helper" |
|---|
| 2 | |
|---|
| 3 | class AppStartTest < ActionController::IntegrationTest |
|---|
| 4 | |
|---|
| 5 | def setup |
|---|
| 6 | AppModel.sync |
|---|
| 7 | end |
|---|
| 8 | |
|---|
| 9 | def test_redirect_to_home |
|---|
| 10 | open_session do |session| |
|---|
| 11 | get "/" |
|---|
| 12 | assert_response :redirect |
|---|
| 13 | follow_redirect! |
|---|
| 14 | assert_template "navigation/show_index" |
|---|
| 15 | end |
|---|
| 16 | end |
|---|
| 17 | |
|---|
| 18 | def test_redirect_to_repo_select_when_no_repo_selected |
|---|
| 19 | open_session do |session| |
|---|
| 20 | SemanticRecord::Base::repository['repository'] = nil |
|---|
| 21 | get "/" |
|---|
| 22 | assert_response :redirect |
|---|
| 23 | follow_redirect! |
|---|
| 24 | assert_template "repository/select" |
|---|
| 25 | end |
|---|
| 26 | end |
|---|
| 27 | |
|---|
| 28 | def test_redirect_to_meta_environment_when_no_landmarks |
|---|
| 29 | landmarks = Landmark.find_all |
|---|
| 30 | landmarks.each { |l| l.destroy } |
|---|
| 31 | open_session do |session| |
|---|
| 32 | get "/" |
|---|
| 33 | assert_response :redirect |
|---|
| 34 | follow_redirect! |
|---|
| 35 | assert_template "nav_class/list" |
|---|
| 36 | end |
|---|
| 37 | ensure |
|---|
| 38 | landmarks.each { |l| l.clone.save } |
|---|
| 39 | end |
|---|
| 40 | |
|---|
| 41 | end |
|---|