5416: Browse git repository contents in workbench.
[arvados.git] / apps / workbench / test / integration / repositories_browse_test.rb
1 require 'integration_helper'
2 require 'helpers/repository_stub_helper'
3 require 'helpers/share_object_helper'
4
5 class RepositoriesTest < ActionDispatch::IntegrationTest
6   include RepositoryStubHelper
7   include ShareObjectHelper
8
9   reset_api_fixtures :after_each_test, false
10
11   setup do
12     need_javascript
13   end
14
15   test "browse repository from jobs#show" do
16     sha1 = api_fixture('jobs')['running']['script_version']
17     _, fakecommit, fakefile =
18       stub_repo_content sha1: sha1, filename: 'crunch_scripts/hash'
19     show_object_using 'active', 'jobs', 'running', sha1
20     click_on api_fixture('jobs')['running']['script']
21     assert_text fakefile
22     click_on 'crunch_scripts'
23     assert_selector 'td a', text: 'hash'
24     click_on 'foo'
25     assert_selector 'td a', text: 'crunch_scripts'
26     click_on sha1
27     assert_text fakecommit
28
29     show_object_using 'active', 'jobs', 'running', sha1
30     click_on 'active/foo'
31     assert_selector 'td a', text: 'crunch_scripts'
32
33     show_object_using 'active', 'jobs', 'running', sha1
34     click_on sha1
35     assert_text fakecommit
36   end
37 end