assert_response :success
end
- test "update script_parameters one at a time using merge param" do
- template_fixture = api_fixture('pipeline_templates')['two_part']
- post :update, params: {
- id: api_fixture("pipeline_instances")["pipeline_to_merge_params"]["uuid"],
- pipeline_instance: {
- components: {
- "part-two" => {
- script_parameters: {
- integer_with_value: {
- value: 9
- },
- plain_string: {
- value: 'quux'
- },
- }
- }
- }
- },
- merge: true,
- format: :json
- }, session: session_for(:active)
- assert_response :success
- assert_not_nil assigns(:object)
- orig_params = template_fixture['components']['part-two']['script_parameters']
- new_params = assigns(:object).components[:'part-two'][:script_parameters]
- orig_params.keys.each do |k|
- unless %w(integer_with_value plain_string).index(k)
- assert_equal orig_params[k].to_json, new_params[k.to_sym].to_json
- end
- end
- end
-
test "component rendering copes with unexpected components format" do
get(:show,
params: {id: api_fixture("pipeline_instances")["components_is_jobspec"]["uuid"]},
assert_equal api_fixture('users', 'subproject_admin')['uuid'], new_specimen.owner_uuid
end
- # An object which does not offer an expired_at field but has a xx_owner_uuid_name_unique constraint
- # will be renamed when removed and another object with the same name exists in user's home project.
- [
- ['pipeline_templates', 'template_in_asubproject_with_same_name_as_one_in_active_user_home'],
- ].each do |dm, fixture|
- test "removing #{dm} from a subproject results in renaming it when there is another such object with same name in home project" do
- object = api_fixture(dm, fixture)
- delete(:remove_item,
- params: { id: api_fixture('groups', 'asubproject')['uuid'],
- item_uuid: object['uuid'],
- format: 'js' },
- session: session_for(:active))
- assert_response :success
- assert_match(/\b#{object['uuid']}\b/, @response.body,
- "removed object not named in response")
- use_token :active
- if dm.eql?('groups')
- found = Group.find(object['uuid'])
- else
- found = PipelineTemplate.find(object['uuid'])
- end
- assert_equal api_fixture('users', 'active')['uuid'], found.owner_uuid
- assert_equal true, found.name.include?(object['name'] + ' removed from ')
- end
- end
-
test 'projects#show tab infinite scroll partial obeys limit' do
get_contents_rows(limit: 1, filters: [['uuid','is_a',['arvados#job']]])
assert_response :success
StringIO.new content, 'r'
end
- test "add job description" do
- job = api_fixture('jobs')['nearly_finished_job']
- visit page_with_token("active", "/jobs/#{job['uuid']}")
-
- # edit job description
- within('.arv-description-as-subtitle') do
- find('.fa-pencil').click
- find('.editable-input textarea').set('*Textile description for job* - "Go to dashboard":/')
- find('.editable-submit').click
- end
-
- # Verify edited description
- assert_no_text '*Textile description for job*'
- assert_text 'Textile description for job'
- assert_selector 'a[href="/"]', text: 'Go to dashboard'
- end
-
[
['active', true],
['job_reader2', false],
"components JSON not found")
end
- test "pipeline template description" do
- need_javascript
- visit page_with_token("active", "/pipeline_templates")
-
- # go to Two Part pipeline template
- within first('tr', text: 'Two Part Pipeline Template') do
- find(".fa-gears").click
- end
-
- # edit template description
- within('.arv-description-as-subtitle') do
- find('.fa-pencil').click
- find('.editable-input textarea').set('*Textile description for pipeline template* - "Go to dashboard":/')
- find('.editable-submit').click
- end
- wait_for_ajax
-
- # Verfiy edited description
- assert page.has_no_text? '*Textile description for pipeline template*'
- assert page.has_text? 'Textile description for pipeline template'
- assert page.has_link? 'Go to dashboard'
- click_link 'Go to dashboard'
- assert page.has_text? 'Recent pipelines and processes'
-
- # again visit recent templates page and verify edited description
- visit page_with_token("active", "/pipeline_templates")
- assert page.has_no_text? '*Textile description for pipeline template*'
- assert page.has_text? 'Textile description for pipeline template'
- end
end