openshift-origin-console 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/COPYRIGHT +1 -0
- data/Gemfile +21 -0
- data/LICENSE +203 -0
- data/README.md +123 -0
- data/Rakefile +44 -0
- data/app/assets/images/cartridge-edge.gif +0 -0
- data/app/assets/images/console/arrow-down.png +0 -0
- data/app/assets/images/console/console-sprite.png +0 -0
- data/app/assets/images/favicon-32.png +0 -0
- data/app/assets/images/loader-dark.gif +0 -0
- data/app/assets/images/loader.gif +0 -0
- data/app/assets/images/sprite-vert.png +0 -0
- data/app/assets/javascripts/console.js +10 -0
- data/app/assets/javascripts/console/form.js.coffee +51 -0
- data/app/assets/stylesheets/_alerts.scss +84 -0
- data/app/assets/stylesheets/_breadcrumbs.scss +31 -0
- data/app/assets/stylesheets/_buttons.scss +229 -0
- data/app/assets/stylesheets/_code.scss +86 -0
- data/app/assets/stylesheets/_custom.scss +207 -0
- data/app/assets/stylesheets/_footer.scss +54 -0
- data/app/assets/stylesheets/_forms.scss +710 -0
- data/app/assets/stylesheets/_grid.scss +28 -0
- data/app/assets/stylesheets/_input-prepend-append.scss +138 -0
- data/app/assets/stylesheets/_labels.scss +40 -0
- data/app/assets/stylesheets/_mixins.scss +76 -0
- data/app/assets/stylesheets/_override-variables.scss +1 -0
- data/app/assets/stylesheets/_responsive.scss +438 -0
- data/app/assets/stylesheets/_ribbon.scss +57 -0
- data/app/assets/stylesheets/_type.scss +306 -0
- data/app/assets/stylesheets/_utilities.scss +10 -0
- data/app/assets/stylesheets/_variables.scss +131 -0
- data/app/assets/stylesheets/common.css.scss +82 -0
- data/app/assets/stylesheets/console/_application.scss +194 -0
- data/app/assets/stylesheets/console/_base.scss +26 -0
- data/app/assets/stylesheets/console/_breadcrumbs.scss +32 -0
- data/app/assets/stylesheets/console/_buttons.scss +214 -0
- data/app/assets/stylesheets/console/_core.scss +1002 -0
- data/app/assets/stylesheets/console/_dropdowns.scss +63 -0
- data/app/assets/stylesheets/console/_help.scss +54 -0
- data/app/assets/stylesheets/console/_mixins.scss +11 -0
- data/app/assets/stylesheets/console/_navbar.scss +415 -0
- data/app/assets/stylesheets/console/_ribbon.scss +82 -0
- data/app/assets/stylesheets/console/_tile.scss +122 -0
- data/app/assets/stylesheets/origin.css.scss +37 -0
- data/app/controllers/account/dashboard.rb +13 -0
- data/app/controllers/account_controller.rb +3 -0
- data/app/controllers/application_types_controller.rb +80 -0
- data/app/controllers/applications_controller.rb +183 -0
- data/app/controllers/building_controller.rb +81 -0
- data/app/controllers/capability_aware.rb +18 -0
- data/app/controllers/cartridge_types_controller.rb +53 -0
- data/app/controllers/cartridges_controller.rb +43 -0
- data/app/controllers/console/auth/basic.rb +65 -0
- data/app/controllers/console/auth/none.rb +5 -0
- data/app/controllers/console/auth/remote_user.rb +69 -0
- data/app/controllers/console/rescue.rb +48 -0
- data/app/controllers/console_controller.rb +19 -0
- data/app/controllers/console_index_controller.rb +14 -0
- data/app/controllers/domain_aware.rb +26 -0
- data/app/controllers/domain_session_sweeper.rb +29 -0
- data/app/controllers/domains_controller.rb +30 -0
- data/app/controllers/keys_controller.rb +43 -0
- data/app/controllers/scaling_controller.rb +46 -0
- data/app/controllers/sshkey_aware.rb +23 -0
- data/app/controllers/sshkey_session_sweeper.rb +29 -0
- data/app/controllers/user_session_sweeper.rb +29 -0
- data/app/helpers/console/community_helper.rb +78 -0
- data/app/helpers/console/console_helper.rb +26 -0
- data/app/helpers/console/help_helper.rb +270 -0
- data/app/helpers/console/html5_boilerplate_helper.rb +63 -0
- data/app/helpers/console/layout_helper.rb +277 -0
- data/app/helpers/console/model_helper.rb +106 -0
- data/app/helpers/console/secured_helper.rb +5 -0
- data/app/models/alias.rb +10 -0
- data/app/models/application.rb +148 -0
- data/app/models/application_associations.rb +36 -0
- data/app/models/application_template.rb +90 -0
- data/app/models/application_type.rb +258 -0
- data/app/models/async_aware.rb +60 -0
- data/app/models/capabilities.rb +62 -0
- data/app/models/cartridge.rb +122 -0
- data/app/models/cartridge_type.rb +140 -0
- data/app/models/domain.rb +44 -0
- data/app/models/domain_associations.rb +33 -0
- data/app/models/embedded.rb +11 -0
- data/app/models/gear.rb +13 -0
- data/app/models/gear_group.rb +104 -0
- data/app/models/key.rb +87 -0
- data/app/models/quickstart.rb +135 -0
- data/app/models/rest_api.rb +130 -0
- data/app/models/rest_api/base.rb +781 -0
- data/app/models/rest_api/cacheable.rb +91 -0
- data/app/models/rest_api/environment.rb +13 -0
- data/app/models/rest_api/info.rb +34 -0
- data/app/models/rest_api/log_subscriber.rb +29 -0
- data/app/models/rest_api/railties/controller_runtime.rb +37 -0
- data/app/models/user.rb +27 -0
- data/app/models/user_associations.rb +6 -0
- data/app/views/account/_domain.html.haml +14 -0
- data/app/views/account/_keys.html.haml +20 -0
- data/app/views/account/_user.html.haml +5 -0
- data/app/views/account/show.html.haml +15 -0
- data/app/views/application_templates/_application_template.html.haml +5 -0
- data/app/views/application_types/_application_type.html.haml +19 -0
- data/app/views/application_types/_custom.html.haml +19 -0
- data/app/views/application_types/_persisted.html.haml +26 -0
- data/app/views/application_types/_tile.html.haml +9 -0
- data/app/views/application_types/index.html.haml +87 -0
- data/app/views/application_types/search.html.haml +67 -0
- data/app/views/application_types/show.html.haml +219 -0
- data/app/views/applications/_application.html.haml +34 -0
- data/app/views/applications/_applications_filter.html.haml +8 -0
- data/app/views/applications/_footer.html.haml +0 -0
- data/app/views/applications/_name.html.haml +28 -0
- data/app/views/applications/delete.html.haml +19 -0
- data/app/views/applications/get_started.html.haml +145 -0
- data/app/views/applications/index.html.haml +55 -0
- data/app/views/applications/show.html.haml +193 -0
- data/app/views/building/delete.html.haml +22 -0
- data/app/views/building/new.html.haml +57 -0
- data/app/views/building/show.html.haml +12 -0
- data/app/views/cartridge_types/_cartridge_type.html.haml +61 -0
- data/app/views/cartridge_types/index.html.haml +37 -0
- data/app/views/cartridge_types/show.html.haml +21 -0
- data/app/views/cartridges/next_steps.html.haml +58 -0
- data/app/views/cartridges/show.html.haml +1 -0
- data/app/views/console/error.html.haml +58 -0
- data/app/views/console/help.html.haml +90 -0
- data/app/views/console/not_found.html.haml +69 -0
- data/app/views/console/unauthorized.html.haml +7 -0
- data/app/views/domains/_domain.html.haml +14 -0
- data/app/views/domains/_form.html.haml +13 -0
- data/app/views/domains/edit.html.haml +5 -0
- data/app/views/domains/new.html.haml +6 -0
- data/app/views/keys/_form.html.haml +14 -0
- data/app/views/keys/_simple_form.html.haml +14 -0
- data/app/views/keys/new.html.haml +2 -0
- data/app/views/layouts/_footer.html.haml +38 -0
- data/app/views/layouts/_head.html.haml +35 -0
- data/app/views/layouts/console.html.haml +60 -0
- data/app/views/layouts/console/_header.html.haml +44 -0
- data/app/views/layouts/console/_identity.html.haml +7 -0
- data/app/views/layouts/console/_javascripts.html.haml +5 -0
- data/app/views/layouts/console/_stylesheets.html.haml +6 -0
- data/app/views/scaling/delete.html.haml +17 -0
- data/app/views/scaling/new.html.haml +24 -0
- data/app/views/scaling/show.html.haml +81 -0
- data/app/views/shared/_tracking.html.haml +0 -0
- data/conf/console.conf.example +108 -0
- data/conf/openshift_console.conf +10 -0
- data/config/cartridge_types.yml +54 -0
- data/config/initializers/barista_config.rb +86 -0
- data/config/initializers/cartridge_types.rb +5 -0
- data/config/initializers/console_security.rb +1 -0
- data/config/initializers/date_helper.rb +5 -0
- data/config/initializers/extended_logger.rb +51 -0
- data/config/initializers/formtastic.rb +100 -0
- data/config/initializers/inflections.rb +38 -0
- data/config/initializers/rdiscount.rb +8 -0
- data/config/initializers/rest_api.rb +22 -0
- data/config/initializers/sass.rb +30 -0
- data/config/initializers/session_trace.rb +32 -0
- data/config/initializers/x_frame_options.rb +53 -0
- data/config/locales/en.yml +12 -0
- data/lib/active_resource/associations.rb +107 -0
- data/lib/active_resource/associations/builder/association.rb +35 -0
- data/lib/active_resource/associations/builder/belongs_to.rb +5 -0
- data/lib/active_resource/associations/builder/has_many.rb +5 -0
- data/lib/active_resource/associations/builder/has_one.rb +5 -0
- data/lib/active_resource/persistent_connection.rb +341 -0
- data/lib/active_resource/persistent_http_mock.rb +68 -0
- data/lib/active_resource/reflection.rb +78 -0
- data/lib/console.rb +8 -0
- data/lib/console/config_file.rb +13 -0
- data/lib/console/configuration.rb +163 -0
- data/lib/console/engine.rb +28 -0
- data/lib/console/formtastic/bootstrap_form_builder.rb +369 -0
- data/lib/console/rails/app_redirector.rb +40 -0
- data/lib/console/rails/filter_hash.rb +15 -0
- data/lib/console/rails/routes.rb +51 -0
- data/lib/console/version.rb +5 -0
- data/lib/tasks/assets.rake +79 -0
- data/lib/tasks/stats.rake +18 -0
- data/lib/tasks/test_suites.rake +73 -0
- data/test/coverage_helper.rb +27 -0
- data/test/fixtures/cartridges.json +1 -0
- data/test/fixtures/quickstarts.csv +3 -0
- data/test/functional/account_controller_test.rb +14 -0
- data/test/functional/application_types_controller_test.rb +251 -0
- data/test/functional/applications_controller_sanity_test.rb +26 -0
- data/test/functional/applications_controller_test.rb +365 -0
- data/test/functional/building_controller_test.rb +203 -0
- data/test/functional/cartridge_types_controller_isolation_test.rb +68 -0
- data/test/functional/cartridge_types_controller_test.rb +48 -0
- data/test/functional/cartridges_controller_test.rb +83 -0
- data/test/functional/console_auth_basic_controller_test.rb +82 -0
- data/test/functional/console_auth_remote_user_controller_test.rb +90 -0
- data/test/functional/console_index_controller_test.rb +22 -0
- data/test/functional/domains_controller_test.rb +194 -0
- data/test/functional/keys_controller_test.rb +163 -0
- data/test/functional/quickstarts.json +18 -0
- data/test/functional/scaling_controller_test.rb +153 -0
- data/test/integration/assets_test.rb +34 -0
- data/test/integration/help_link_test.rb +43 -0
- data/test/integration/quickstarts_test.rb +24 -0
- data/test/integration/rescue_from_test.rb +25 -0
- data/test/integration/rest_api/application_test.rb +115 -0
- data/test/integration/rest_api/cartridge_test.rb +44 -0
- data/test/integration/rest_api/cartridge_type_test.rb +143 -0
- data/test/integration/rest_api/domain_test.rb +91 -0
- data/test/integration/rest_api/info_test.rb +9 -0
- data/test/integration/rest_api/key_test.rb +85 -0
- data/test/integration/static_pages_test.rb +44 -0
- data/test/rails_app/Rakefile +7 -0
- data/test/rails_app/app/controllers/application_controller.rb +5 -0
- data/test/rails_app/config.ru +4 -0
- data/test/rails_app/config/application.rb +48 -0
- data/test/rails_app/config/boot.rb +10 -0
- data/test/rails_app/config/database.yml +25 -0
- data/test/rails_app/config/environment.rb +5 -0
- data/test/rails_app/config/environments/development.rb +38 -0
- data/test/rails_app/config/environments/production.rb +70 -0
- data/test/rails_app/config/environments/test.rb +43 -0
- data/test/rails_app/config/initializers/auth.rb +0 -0
- data/test/rails_app/config/initializers/backtrace_silencers.rb +7 -0
- data/test/rails_app/config/initializers/inflections.rb +10 -0
- data/test/rails_app/config/initializers/mime_types.rb +5 -0
- data/test/rails_app/config/initializers/secret_token.rb +7 -0
- data/test/rails_app/config/initializers/session_store.rb +8 -0
- data/test/rails_app/config/locales/en.yml +5 -0
- data/test/rails_app/config/routes.rb +4 -0
- data/test/rails_app/script/rails +6 -0
- data/test/support/auth.rb +111 -0
- data/test/support/base.rb +142 -0
- data/test/support/errors.rb +28 -0
- data/test/support/rest_api.rb +189 -0
- data/test/test_helper.rb +14 -0
- data/test/unit/active_model_compliance_test.rb +23 -0
- data/test/unit/async_aware_test.rb +55 -0
- data/test/unit/configuration_test.rb +158 -0
- data/test/unit/filter_hash_test.rb +64 -0
- data/test/unit/helpers/model_helper_test.rb +61 -0
- data/test/unit/overrides_test.rb +9 -0
- data/test/unit/rest_api_test.rb +1590 -0
- data/vendor/assets/javascripts/MIT-LICENSE.txt +20 -0
- data/vendor/assets/javascripts/bootstrap-collapse.js +157 -0
- data/vendor/assets/javascripts/bootstrap-dropdown.js +100 -0
- data/vendor/assets/javascripts/bootstrap-tab.js +135 -0
- data/vendor/assets/javascripts/bootstrap-transition.js +61 -0
- data/vendor/assets/javascripts/jquery.spin.js +47 -0
- data/vendor/assets/javascripts/jquery.ui.widget.js +16 -0
- data/vendor/assets/javascripts/jquery_cookie.js +41 -0
- data/vendor/assets/javascripts/jquery_validate_min.js +51 -0
- data/vendor/assets/javascripts/modernizr.min.js +2 -0
- data/vendor/assets/javascripts/plugins.js +16 -0
- data/vendor/assets/stylesheets/bootstrap/_accordion.scss +28 -0
- data/vendor/assets/stylesheets/bootstrap/_alerts.scss +70 -0
- data/vendor/assets/stylesheets/bootstrap/_breadcrumbs.scss +22 -0
- data/vendor/assets/stylesheets/bootstrap/_button-groups.scss +147 -0
- data/vendor/assets/stylesheets/bootstrap/_buttons.scss +183 -0
- data/vendor/assets/stylesheets/bootstrap/_carousel.scss +121 -0
- data/vendor/assets/stylesheets/bootstrap/_close.scss +18 -0
- data/vendor/assets/stylesheets/bootstrap/_code.scss +57 -0
- data/vendor/assets/stylesheets/bootstrap/_component-animations.scss +18 -0
- data/vendor/assets/stylesheets/bootstrap/_dropdowns.scss +130 -0
- data/vendor/assets/stylesheets/bootstrap/_forms.scss +522 -0
- data/vendor/assets/stylesheets/bootstrap/_grid.scss +8 -0
- data/vendor/assets/stylesheets/bootstrap/_hero-unit.scss +20 -0
- data/vendor/assets/stylesheets/bootstrap/_labels.scss +32 -0
- data/vendor/assets/stylesheets/bootstrap/_layouts.scss +17 -0
- data/vendor/assets/stylesheets/bootstrap/_mixins.scss +602 -0
- data/vendor/assets/stylesheets/bootstrap/_modals.scss +84 -0
- data/vendor/assets/stylesheets/bootstrap/_navbar.scss +299 -0
- data/vendor/assets/stylesheets/bootstrap/_navs.scss +353 -0
- data/vendor/assets/stylesheets/bootstrap/_pager.scss +30 -0
- data/vendor/assets/stylesheets/bootstrap/_pagination.scss +55 -0
- data/vendor/assets/stylesheets/bootstrap/_popovers.scss +49 -0
- data/vendor/assets/stylesheets/bootstrap/_progress-bars.scss +95 -0
- data/vendor/assets/stylesheets/bootstrap/_reset.scss +126 -0
- data/vendor/assets/stylesheets/bootstrap/_scaffolding.scss +33 -0
- data/vendor/assets/stylesheets/bootstrap/_sprites.scss +158 -0
- data/vendor/assets/stylesheets/bootstrap/_tables.scss +150 -0
- data/vendor/assets/stylesheets/bootstrap/_thumbnails.scss +35 -0
- data/vendor/assets/stylesheets/bootstrap/_tooltip.scss +35 -0
- data/vendor/assets/stylesheets/bootstrap/_type.scss +218 -0
- data/vendor/assets/stylesheets/bootstrap/_utilities.scss +23 -0
- data/vendor/assets/stylesheets/bootstrap/_variables.scss +107 -0
- data/vendor/assets/stylesheets/bootstrap/_wells.scss +17 -0
- data/vendor/assets/stylesheets/bootstrap/bootstrap.scss +66 -0
- data/vendor/assets/stylesheets/bootstrap/responsive.scss +334 -0
- metadata +506 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
require File.expand_path('../../test_helper', __FILE__)
|
|
2
|
+
|
|
3
|
+
class ApplicationsControllerSanityTest < ActionController::TestCase
|
|
4
|
+
tests ApplicationsController
|
|
5
|
+
|
|
6
|
+
def get_post_form(name = 'cart!diy-0.1')
|
|
7
|
+
{
|
|
8
|
+
:name => 'test1',
|
|
9
|
+
:application_type => name,
|
|
10
|
+
:domain_id => uuid.to_s
|
|
11
|
+
}
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
test "should create application and domain, and delete app" do
|
|
15
|
+
with_unique_user
|
|
16
|
+
post(:create, {:application => get_post_form})
|
|
17
|
+
|
|
18
|
+
assert app = assigns(:application)
|
|
19
|
+
assert app.errors.empty?, app.errors.to_hash.inspect
|
|
20
|
+
assert domain = assigns(:domain)
|
|
21
|
+
assert_redirected_to get_started_application_path(app, :wizard => true)
|
|
22
|
+
|
|
23
|
+
delete :destroy, :id => app.id
|
|
24
|
+
assert_redirected_to applications_path
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
require File.expand_path('../../test_helper', __FILE__)
|
|
2
|
+
|
|
3
|
+
class ApplicationsControllerTest < ActionController::TestCase
|
|
4
|
+
|
|
5
|
+
test "should create and delete app" do
|
|
6
|
+
# in applications_controller_sanity_test
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
test 'template create and destroy' do
|
|
10
|
+
with_unique_domain
|
|
11
|
+
type = ApplicationType.all.select(&:template?).sample(1).first
|
|
12
|
+
omit("No templates are installed on this server") if type.nil?
|
|
13
|
+
post(:create, {:application => get_post_form(type.id)})
|
|
14
|
+
|
|
15
|
+
assert app = assigns(:application)
|
|
16
|
+
assert app.errors.empty?, app.errors.inspect
|
|
17
|
+
assert app.persisted?, app.inspect
|
|
18
|
+
|
|
19
|
+
app.destroy
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
test 'should redirect new to types' do
|
|
23
|
+
with_configured_user
|
|
24
|
+
get :new
|
|
25
|
+
assert_redirected_to application_types_path
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
test 'report and clear cached error if domain not found' do
|
|
29
|
+
with_configured_user
|
|
30
|
+
session[:domain] = 'does_not_exist'
|
|
31
|
+
get :index
|
|
32
|
+
assert_not_found_page(/Domain 'does_not_exist' does not exist/)
|
|
33
|
+
assert_nil session[:domain]
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
test 'index will cache domain' do
|
|
37
|
+
with_unique_domain
|
|
38
|
+
get :index
|
|
39
|
+
assert_equal @domain.id, session[:domain]
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
test 'index will use cached domain' do
|
|
43
|
+
with_unique_domain
|
|
44
|
+
session[:domain] = @domain.id
|
|
45
|
+
Domain.expects(:find).never
|
|
46
|
+
get :index
|
|
47
|
+
assert_equal @domain.id, session[:domain]
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
test "should assign domain errors on empty name" do
|
|
51
|
+
with_unique_user
|
|
52
|
+
app_params = get_post_form
|
|
53
|
+
post(:create, {:application => app_params})
|
|
54
|
+
|
|
55
|
+
assert_template 'application_types/show'
|
|
56
|
+
assert app = assigns(:application)
|
|
57
|
+
assert !app.errors.empty?
|
|
58
|
+
assert app.errors[:domain_name].present?, app.errors.inspect
|
|
59
|
+
assert_equal 1, app.errors[:domain_name].length
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
test "should assign errors on empty name" do
|
|
63
|
+
with_domain
|
|
64
|
+
app_params = get_post_form
|
|
65
|
+
app_params[:name] = ''
|
|
66
|
+
post(:create, {:application => app_params})
|
|
67
|
+
|
|
68
|
+
assert_template 'application_types/show'
|
|
69
|
+
assert app = assigns(:application)
|
|
70
|
+
assert !app.errors.empty?
|
|
71
|
+
assert app.errors[:name].present?, app.errors.inspect
|
|
72
|
+
assert_equal 1, app.errors[:name].length
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
test "should assign errors when advanced form" do
|
|
76
|
+
with_domain
|
|
77
|
+
app_params = get_post_form
|
|
78
|
+
app_params[:name] = ''
|
|
79
|
+
post(:create, {:application => app_params, :application_type => 'custom', :advanced => true})
|
|
80
|
+
|
|
81
|
+
assert_template 'application_types/show'
|
|
82
|
+
assert app = assigns(:application)
|
|
83
|
+
assert !app.errors.empty?
|
|
84
|
+
assert app.errors[:name].present?, app.errors.to_hash.inspect
|
|
85
|
+
assert_equal 1, app.errors[:name].length
|
|
86
|
+
|
|
87
|
+
assert_select '.alert.alert-error', /No cartridges are defined for this type/i
|
|
88
|
+
assert_select 'h3 > span.text-warning', 'None'
|
|
89
|
+
assert_select '.btn-primary[disabled=disabled]'
|
|
90
|
+
assert_select "select[name='application[scale]']"
|
|
91
|
+
assert_select "input[name='application[initial_git_url]']" do |inputs|
|
|
92
|
+
assert_nil inputs.first['value']
|
|
93
|
+
end
|
|
94
|
+
#assert_select "input[name='application[initial_git_branch]']" do |inputs|
|
|
95
|
+
# assert_nil inputs.first['value']
|
|
96
|
+
#end
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
test "should assign errors when advanced form with carts" do
|
|
100
|
+
with_domain
|
|
101
|
+
app_params = get_post_form
|
|
102
|
+
app_type = {
|
|
103
|
+
:id => 'custom',
|
|
104
|
+
:cartridges => ['ruby-'],
|
|
105
|
+
:initial_git_url => 'http://foo.com',
|
|
106
|
+
:initial_git_branch => 'bar',
|
|
107
|
+
}
|
|
108
|
+
app_params[:name] = ''
|
|
109
|
+
app_params[:cartridges] = ['ruby-1.8']
|
|
110
|
+
app_params[:scale] = 'true'
|
|
111
|
+
post(:create, {:application => app_params, :application_type => app_type, :advanced => true})
|
|
112
|
+
|
|
113
|
+
assert_template 'application_types/show'
|
|
114
|
+
assert app = assigns(:application)
|
|
115
|
+
assert !app.errors.empty?
|
|
116
|
+
assert app.errors[:name].present?, app.errors.inspect
|
|
117
|
+
assert_equal 1, app.errors[:name].length
|
|
118
|
+
|
|
119
|
+
assert_select '.alert.alert-error', /Application name is required/i
|
|
120
|
+
assert_select "select[name='application[scale]'] > option[selected]", 'Scale with web traffic'
|
|
121
|
+
assert_select "input[name='application[initial_git_url]'][value=http://foo.com]"
|
|
122
|
+
#assert_select "input[name='application[initial_git_branch]'][value=bar]"
|
|
123
|
+
assert_select "select[name='application[cartridges][]'] > option[selected]", 'Ruby 1.8'
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
test "should assign errors on long name" do
|
|
127
|
+
with_domain
|
|
128
|
+
app_params = get_post_form
|
|
129
|
+
app_params[:name] = 'aoeu'*30
|
|
130
|
+
post(:create, {:application => app_params})
|
|
131
|
+
|
|
132
|
+
assert_template 'application_types/show'
|
|
133
|
+
assert app = assigns(:application)
|
|
134
|
+
assert assigns(:domain)
|
|
135
|
+
assert !app.errors.empty?
|
|
136
|
+
assert app.errors[:name].present?, app.errors.inspect
|
|
137
|
+
assert_equal 1, app.errors[:name].length, app.errors.inspect
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
test "should assign errors on invalid characters" do
|
|
141
|
+
with_domain
|
|
142
|
+
app_params = get_post_form
|
|
143
|
+
app_params[:name] = '@@ @@'
|
|
144
|
+
post(:create, {:application => app_params})
|
|
145
|
+
|
|
146
|
+
assert_template 'application_types/show'
|
|
147
|
+
assert app = assigns(:application)
|
|
148
|
+
assert assigns(:domain)
|
|
149
|
+
assert !app.errors.empty?
|
|
150
|
+
assert app.errors[:name].present?, app.errors.inspect
|
|
151
|
+
assert_equal 1, app.errors[:name].length, app.errors.inspect
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
test "should assign errors on invalid gear size" do
|
|
155
|
+
with_domain
|
|
156
|
+
app_params = get_post_form
|
|
157
|
+
app_params[:gear_profile] = 'foobar'
|
|
158
|
+
post(:create, {:application => app_params})
|
|
159
|
+
|
|
160
|
+
assert_template 'application_types/show'
|
|
161
|
+
assert app = assigns(:application)
|
|
162
|
+
assert !app.persisted?
|
|
163
|
+
assert !app.errors.empty?
|
|
164
|
+
# I need to be fixed to be gear_profile
|
|
165
|
+
assert app.errors[:node_profile].present?, app.errors.to_hash.inspect
|
|
166
|
+
assert_equal 1, app.errors[:node_profile].length, app.errors.to_hash.inspect
|
|
167
|
+
|
|
168
|
+
assert_select '.alert', /Invalid size: foobar/i
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
test "should retrieve application list" do
|
|
172
|
+
app = with_app
|
|
173
|
+
|
|
174
|
+
# get full version of the list
|
|
175
|
+
get(:index)
|
|
176
|
+
apps = assigns(:applications)
|
|
177
|
+
assert apps
|
|
178
|
+
assert_equal apps.length, 1
|
|
179
|
+
apps[0].name == app.name
|
|
180
|
+
assert_response :success
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
test "should filter application list with name" do
|
|
184
|
+
app = with_app
|
|
185
|
+
|
|
186
|
+
# get a filtered version of the list
|
|
187
|
+
get(:index, :applications_filter => {:name => app.name})
|
|
188
|
+
apps = assigns(:applications)
|
|
189
|
+
assert apps
|
|
190
|
+
assert_equal apps.length, 1
|
|
191
|
+
assert_equal apps[0].name, app.name
|
|
192
|
+
assert_response :success
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
test "should not filter application list with other name" do
|
|
196
|
+
app = with_app
|
|
197
|
+
|
|
198
|
+
# get a filtered version of the list
|
|
199
|
+
get(:index, :applications_filter => {:name => 'not'})
|
|
200
|
+
apps = assigns(:applications)
|
|
201
|
+
assert apps
|
|
202
|
+
assert_equal apps.length, 0
|
|
203
|
+
assert_response :success
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
test "should retrieve application details" do
|
|
207
|
+
get :show, :id => with_app.name
|
|
208
|
+
assert_response :success
|
|
209
|
+
assert app = assigns(:application)
|
|
210
|
+
assert_equal with_app.name, app.name
|
|
211
|
+
assert groups = assigns(:gear_groups)
|
|
212
|
+
assert_equal 1, groups.length
|
|
213
|
+
assert (groups[0].cartridges.map(&:name) - with_app.cartridges.map(&:name)).empty?
|
|
214
|
+
assert groups[0].cartridges[0].display_name
|
|
215
|
+
assert domain = assigns(:domain)
|
|
216
|
+
assert !assigns(:has_keys)
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
test "should retrieve application details with has_sshkey cache set" do
|
|
220
|
+
session[:has_sshkey] = true
|
|
221
|
+
get :show, :id => with_app.name
|
|
222
|
+
assert_response :success
|
|
223
|
+
assert app = assigns(:application)
|
|
224
|
+
assert has_keys = assigns(:has_keys)
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
test "should retrieve scalable application details" do
|
|
228
|
+
get :show, :id => with_scalable_app.name
|
|
229
|
+
assert_response :success
|
|
230
|
+
assert app = assigns(:application)
|
|
231
|
+
assert_equal with_scalable_app.name, app.name
|
|
232
|
+
assert groups = assigns(:gear_groups)
|
|
233
|
+
assert_equal 1, groups.length, groups.pretty_inspect
|
|
234
|
+
assert (groups[0].cartridges.map(&:name) - with_scalable_app.cartridges.map(&:name)).empty?
|
|
235
|
+
assert domain = assigns(:domain)
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
test "should retrieve application get started page" do
|
|
239
|
+
get :get_started, :id => with_app.name
|
|
240
|
+
assert_response :success
|
|
241
|
+
assert app = assigns(:application)
|
|
242
|
+
assert_equal with_app.name, app.name
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
test "should retrieve application delete confirm page" do
|
|
246
|
+
get :delete, :id => with_app.name
|
|
247
|
+
assert_response :success
|
|
248
|
+
assert app = assigns(:application)
|
|
249
|
+
assert_equal with_app.name, app.name
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
test "should result in a not found error when retrieving an application that does not exist" do
|
|
253
|
+
with_app
|
|
254
|
+
with_rescue_from{ get :show, :id => 'idontexist' }
|
|
255
|
+
assert_response :success
|
|
256
|
+
assert_select 'h1', /Application 'idontexist' does not exist/
|
|
257
|
+
assert_select 'a', "Application #{with_app.name}"
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
test "should result in a not found when retrieving a domain that does not exist" do
|
|
261
|
+
with_unique_user
|
|
262
|
+
with_rescue_from{ get :show, :id => 'idontexist' }
|
|
263
|
+
assert_response :success
|
|
264
|
+
assert_select 'h1', /Domain does not exist/
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
test "should result in a not found when retrieving an application that does not exist" do
|
|
268
|
+
with_domain
|
|
269
|
+
get :show, :id => 'idontexist'
|
|
270
|
+
assert_response :success
|
|
271
|
+
assert_select 'h1', /Application 'idontexist' does not exist/
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
test 'should combine messages correctly for template creation' do
|
|
275
|
+
with_unique_domain
|
|
276
|
+
template = ApplicationType.all.select(&:template?).select{ |t| t.template.credentials_message }.sample(1).first
|
|
277
|
+
omit("No templates installed on this system") if template.nil?
|
|
278
|
+
saved = states('saved').starts_as('no')
|
|
279
|
+
Application.any_instance.expects(:save).returns(true).then(saved.is('yes'))
|
|
280
|
+
Application.any_instance.expects(:persisted?).at_least_once.returns(false).when(saved.is('no'))
|
|
281
|
+
Application.any_instance.expects(:persisted?).at_least_once.returns(true).when(saved.is('yes'))
|
|
282
|
+
Application.any_instance.expects(:remote_results).at_least_once.returns(['message'])
|
|
283
|
+
post(:create, {:application => get_post_form(template.id)})
|
|
284
|
+
|
|
285
|
+
assert_equal ['message', template.template.credentials_message], flash[:info_pre]
|
|
286
|
+
end
|
|
287
|
+
|
|
288
|
+
test 'invalid destroy should render page' do
|
|
289
|
+
Application.any_instance.expects(:destroy).returns(false)
|
|
290
|
+
delete :destroy, :id => with_app.name
|
|
291
|
+
assert_response :success
|
|
292
|
+
assert_template :delete
|
|
293
|
+
end
|
|
294
|
+
|
|
295
|
+
test 'should support the creation of scalable apps with medium gears for privileged users' do
|
|
296
|
+
with_user_with_multiple_gear_sizes
|
|
297
|
+
find_or_create_domain
|
|
298
|
+
|
|
299
|
+
user = User.find(:one, :as => @controller.current_user)
|
|
300
|
+
@domain.applications.each(&:destroy) unless user.gears_free >= 2
|
|
301
|
+
|
|
302
|
+
medium_gear_app = {
|
|
303
|
+
:name => uuid,
|
|
304
|
+
:application_type => 'cart!php-5.3',
|
|
305
|
+
:gear_profile => 'medium',
|
|
306
|
+
:scale => 'true',
|
|
307
|
+
:domain_name => @domain.name
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
# Make the request
|
|
311
|
+
post(:create, {:application => medium_gear_app})
|
|
312
|
+
|
|
313
|
+
# Confirm app attributes
|
|
314
|
+
assert app = assigns(:application)
|
|
315
|
+
assert app.errors.empty?, app.errors.inspect
|
|
316
|
+
assert_equal 'medium', app.gear_profile
|
|
317
|
+
assert_equal 'true', app.scale.to_s
|
|
318
|
+
assert app.persisted?
|
|
319
|
+
|
|
320
|
+
app.destroy
|
|
321
|
+
end
|
|
322
|
+
|
|
323
|
+
test 'should not allow medium gears for non-privileged users' do
|
|
324
|
+
with_unique_domain
|
|
325
|
+
medium_gear_app_form = {
|
|
326
|
+
:name => uuid,
|
|
327
|
+
:application_type => 'cart!php-5.3',
|
|
328
|
+
:gear_profile => 'medium',
|
|
329
|
+
:domain_name => @domain.name
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
post(:create, {:application => medium_gear_app_form})
|
|
333
|
+
|
|
334
|
+
assert_response :success
|
|
335
|
+
assert app = assigns(:application)
|
|
336
|
+
assert app.errors.messages[:node_profile][0].match('Invalid Size: medium')
|
|
337
|
+
end
|
|
338
|
+
|
|
339
|
+
test 'should prevent scaled apps when not enough gears are available' do
|
|
340
|
+
# This space intentionally left blank;
|
|
341
|
+
# Testing this end-to-end would be relatively time consuming right now.
|
|
342
|
+
end
|
|
343
|
+
|
|
344
|
+
# test "should check for empty name" do
|
|
345
|
+
# form = get_post_form
|
|
346
|
+
# form[:name]=''
|
|
347
|
+
# post(:create, {:application => form})
|
|
348
|
+
# assert assigns(:application)
|
|
349
|
+
# assert assigns(:application).errors[:name].length > 0
|
|
350
|
+
# assert_response :success
|
|
351
|
+
# end
|
|
352
|
+
|
|
353
|
+
# test "should redirect on success" do
|
|
354
|
+
# post(:create, :application => get_post_form)
|
|
355
|
+
# assert assigns(:application)
|
|
356
|
+
# assert assigns(:application).errors.empty?
|
|
357
|
+
# assert_redirected_to :action => 'show'
|
|
358
|
+
# assert_template
|
|
359
|
+
# end
|
|
360
|
+
|
|
361
|
+
def get_post_form(name = 'cart!diy-0.1')
|
|
362
|
+
{:name => 'test1', :application_type => name}
|
|
363
|
+
end
|
|
364
|
+
|
|
365
|
+
end
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
require File.expand_path('../../test_helper', __FILE__)
|
|
2
|
+
require 'mocha'
|
|
3
|
+
|
|
4
|
+
class BuildingControllerTest < ActionController::TestCase
|
|
5
|
+
|
|
6
|
+
uses_http_mock
|
|
7
|
+
|
|
8
|
+
def domain
|
|
9
|
+
{:id => 'test'}
|
|
10
|
+
end
|
|
11
|
+
def app_without_builds
|
|
12
|
+
{:name => 'test', :framework => 'php-5.3'}
|
|
13
|
+
end
|
|
14
|
+
def app_can_build
|
|
15
|
+
{:name => 'test', :framework => 'php-5.3', :building_app => 'jenkins'}
|
|
16
|
+
end
|
|
17
|
+
def app_with_builds
|
|
18
|
+
{:name => 'test', :framework => 'php-5.3', :building_with => 'jenkins-client-1.4', :build_job_url => 'Job URL: http://foo/builds', :building_app => 'jenkins'}
|
|
19
|
+
end
|
|
20
|
+
def jenkins_app
|
|
21
|
+
{:name => 'jenkins', :framework => 'jenkins-1.4'}
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def with_app(other_app=nil, app=app_without_builds)
|
|
25
|
+
with_unique_user
|
|
26
|
+
|
|
27
|
+
ActiveResource::HttpMock.respond_to(false) do |mock|
|
|
28
|
+
mock.delete '/broker/rest/domains/test/applications/test/cartridges/jenkins-client-1.4.json', json_header, {}.to_json
|
|
29
|
+
mock.get '/broker/rest/cartridges.json', anonymous_json_header, [
|
|
30
|
+
{:name => 'jenkins-client-1.4', :tags => ['ci_builder']},
|
|
31
|
+
{:name => 'jenkins-1.4', :tags => ['ci']},
|
|
32
|
+
].to_json
|
|
33
|
+
mock.get '/broker/rest/domains.json', json_header, [domain].to_json
|
|
34
|
+
mock.get '/broker/rest/domains/test/applications/test.json', json_header, app.to_json
|
|
35
|
+
mock.get '/broker/rest/domains/test/applications/jenkins.json', json_header, other_app.to_json if other_app
|
|
36
|
+
mock.get '/broker/rest/domains/test/applications.json', json_header, [app, other_app].compact.to_json
|
|
37
|
+
mock.get '/broker/rest/domains/test/applications/test/gear_groups.json', json_header, [
|
|
38
|
+
{:name => '@@app/comp-web/php-5.3', :gears => [
|
|
39
|
+
{:id => 1, :state => 'started'}
|
|
40
|
+
], :cartridges => [
|
|
41
|
+
{:name => 'php-5.3'},
|
|
42
|
+
]},
|
|
43
|
+
{:name => '@@app/comp-proxy/php-5.3', :gears => [
|
|
44
|
+
{:id => 2, :state => 'started'},
|
|
45
|
+
], :cartridges => [
|
|
46
|
+
{:name => 'php-5.3'},
|
|
47
|
+
{:name => 'haproxy-1.4'},
|
|
48
|
+
]},
|
|
49
|
+
{:name => '@@app/comp-mysql/mysql-5.0', :gears => [
|
|
50
|
+
{:id => 3, :state => 'started'},
|
|
51
|
+
], :cartridges => [
|
|
52
|
+
{:name => 'my-sql-5.0'},
|
|
53
|
+
]},
|
|
54
|
+
].to_json
|
|
55
|
+
end
|
|
56
|
+
{:application_id => 'test'}
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def with_jenkins_and_app
|
|
60
|
+
with_unique_user
|
|
61
|
+
with_app(jenkins_app, app_can_build)
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def with_builds
|
|
65
|
+
with_unique_user
|
|
66
|
+
with_app(jenkins_app, app_with_builds)
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
test "should get redirected from show without jenkins client" do
|
|
70
|
+
get :show, with_app
|
|
71
|
+
assert app = assigns(:application)
|
|
72
|
+
assert assigns(:domain)
|
|
73
|
+
assert_redirected_to new_application_building_path(app)
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
test "should get redirected from delete without jenkins client" do
|
|
77
|
+
get :delete, with_app
|
|
78
|
+
assert app = assigns(:application)
|
|
79
|
+
assert assigns(:domain)
|
|
80
|
+
assert_redirected_to new_application_building_path(app)
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
test "should destroy" do
|
|
84
|
+
delete :destroy, with_app
|
|
85
|
+
assert app = assigns(:application)
|
|
86
|
+
assert assigns(:domain)
|
|
87
|
+
assert_redirected_to application_path(app)
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
test "should redraw if destroy fails" do
|
|
91
|
+
args = with_builds
|
|
92
|
+
ActiveResource::HttpMock.respond_to(false) do |mock|
|
|
93
|
+
mock.delete '/broker/rest/domains/test/applications/test/cartridges/jenkins-client-1.4.json', json_header, {:messages => [{:text => 'unable to delete'}]}.to_json, 422
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
delete :destroy, args
|
|
97
|
+
assert assigns(:application)
|
|
98
|
+
assert assigns(:domain)
|
|
99
|
+
assert_response :success
|
|
100
|
+
assert_template :delete
|
|
101
|
+
assert_select '.alert-error', 'unable to delete'
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
test "should see new page without a jenkins app" do
|
|
105
|
+
get :new, with_app
|
|
106
|
+
assert app = assigns(:application)
|
|
107
|
+
assert assigns(:domain)
|
|
108
|
+
assert jenk = assigns(:jenkins_server)
|
|
109
|
+
assert !jenk.persisted?
|
|
110
|
+
assert cart = assigns(:cartridge)
|
|
111
|
+
assert !cart.persisted?
|
|
112
|
+
assert_response :success
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
test "should see new page and load jenkins app" do
|
|
116
|
+
get :new, with_jenkins_and_app
|
|
117
|
+
assert app = assigns(:application)
|
|
118
|
+
assert assigns(:domain)
|
|
119
|
+
assert jenk = assigns(:jenkins_server)
|
|
120
|
+
assert jenk.persisted?
|
|
121
|
+
assert cart = assigns(:cartridge)
|
|
122
|
+
assert !cart.persisted?
|
|
123
|
+
assert_response :success
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
test "should tell the user when the Jenkins app isn't yet registered w/ DNS" do
|
|
127
|
+
# Don't actually sleep for 10 seconds at a go within this test.
|
|
128
|
+
BuildingController.any_instance.expects(:sleep).at_least_once
|
|
129
|
+
|
|
130
|
+
# Set up the cartridge save attempt to fail
|
|
131
|
+
Cartridge.any_instance.expects(:save).at_least_once.returns(false)
|
|
132
|
+
Cartridge.any_instance.expects(:has_exit_code?).at_least_once.returns(true)
|
|
133
|
+
|
|
134
|
+
# Build the REST environment
|
|
135
|
+
args = with_app(jenkins_app, app_can_build)
|
|
136
|
+
|
|
137
|
+
ActiveResource::HttpMock.respond_to(false) do |mock|
|
|
138
|
+
mock.post '/broker/rest/domains/test/applications/test/cartridges.json', json_header(true), { :name => 'jenkins-client-1.4' }.to_json, 422
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Simulate the POST
|
|
142
|
+
post :create, args
|
|
143
|
+
|
|
144
|
+
# Check that the flash text matches our desired message
|
|
145
|
+
assert_match /^The Jenkins server is not yet registered with DNS/, flash[:info_pre]
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
test "should create a jenkins server if it does not exist" do
|
|
149
|
+
args = with_app(nil, app_without_builds)
|
|
150
|
+
|
|
151
|
+
ActiveResource::HttpMock.respond_to(false) do |mock|
|
|
152
|
+
mock.post '/broker/rest/domains/test/applications/test/cartridges.json', json_header(true), { :name => 'jenkins-client-1.4' }.to_json, 201
|
|
153
|
+
mock.post '/broker/rest/domains/test/applications.json', json_header(true), { :name => 'jenkins2', :framework => 'jenkins-1.4', :messages => [{:field => 'result', :text => 'App remote message'}] }.to_json, 201
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
post :create, args.merge({:application => {:name => 'jenkins2'}})
|
|
157
|
+
|
|
158
|
+
assert_redirected_to application_building_path(args[:application_id])
|
|
159
|
+
assert flash[:info_pre].include? 'App remote message'
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
test "should stop if server creation fails" do
|
|
163
|
+
args = with_app(nil, app_without_builds)
|
|
164
|
+
|
|
165
|
+
ActiveResource::HttpMock.respond_to(false) do |mock|
|
|
166
|
+
mock.post '/broker/rest/domains/test/applications.json', json_header(true), { :name => 'jenkins2', :framework => 'jenkins-1.4', :messages => [{:field => 'base', :text => 'App remote error'}] }.to_json, 422
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
post :create, args.merge({:application => {:name => 'jenkins2'}})
|
|
170
|
+
|
|
171
|
+
assert_response :success
|
|
172
|
+
assert_template :new
|
|
173
|
+
assert_select '.alert-error', 'App remote error'
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
test "should create a jenkins server and redraw if cart fails" do
|
|
177
|
+
args = with_app(nil, app_without_builds)
|
|
178
|
+
|
|
179
|
+
ActiveResource::HttpMock.respond_to(false) do |mock|
|
|
180
|
+
mock.post '/broker/rest/domains/test/applications/test/cartridges.json', json_header(true), { :name => 'jenkins-client-1.4' }.to_json, 422
|
|
181
|
+
mock.post '/broker/rest/domains/test/applications.json', json_header(true), { :name => 'jenkins2', :framework => 'jenkins-1.4', :messages => [{:field => 'result', :text => 'App remote message'}] }.to_json, 201
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
post :create, args.merge({:application => {:name => 'jenkins2'}})
|
|
185
|
+
|
|
186
|
+
body = mock_body_for{ |r| /applications.json/ =~ r.path }
|
|
187
|
+
assert_equal 'jenkins-1.4', body['cartridge']
|
|
188
|
+
assert_equal 'jenkins2', body['name']
|
|
189
|
+
|
|
190
|
+
assert_response :success
|
|
191
|
+
assert_template :new
|
|
192
|
+
assert flash[:info_pre].include? 'App remote message'
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
test "should show if all components exist" do
|
|
196
|
+
get :show, with_builds
|
|
197
|
+
assert app = assigns(:application)
|
|
198
|
+
assert app.builds?, app.build_job_url
|
|
199
|
+
assert app.building_with
|
|
200
|
+
assert assigns(:domain)
|
|
201
|
+
assert_response :success
|
|
202
|
+
end
|
|
203
|
+
end
|