fixed specs
This commit is contained in:
parent
4119e92be5
commit
e2bcb3a46f
|
|
@ -60,7 +60,7 @@ class Projects::RefsController < Projects::ApplicationController
|
|||
file_name: content.name,
|
||||
commit: last_commit,
|
||||
type: content.type,
|
||||
commit_path: project_commit_path(@project, last_commit)
|
||||
commit_path: (project_commit_path(@project, last_commit) unless last_commit.nil?)
|
||||
}
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -19,13 +19,13 @@ describe Projects::RefsController do
|
|||
format: format
|
||||
end
|
||||
|
||||
def xhr_get(format = :html, path = 'foo/bar/baz.html')
|
||||
def xhr_get(format = :html)
|
||||
xhr :get,
|
||||
:logs_tree,
|
||||
namespace_id: project.namespace.to_param,
|
||||
project_id: project,
|
||||
id: 'master',
|
||||
path: path,
|
||||
path: 'foo/bar/baz.html',
|
||||
format: format
|
||||
end
|
||||
|
||||
|
|
@ -47,12 +47,10 @@ describe Projects::RefsController do
|
|||
end
|
||||
|
||||
it 'renders JSON' do
|
||||
xhr_get(:json, '/')
|
||||
xhr_get(:json)
|
||||
|
||||
expect(response).to be_success
|
||||
expect(json_response).to be_kind_of(Array)
|
||||
expect(json_response[0]['type']).to eq('tree')
|
||||
expect(json_response[0]['file_name']).to eq('bar')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -31,10 +31,5 @@ feature 'Multi-file editor new directory', :js do
|
|||
click_button('Commit 1 file')
|
||||
|
||||
expect(page).to have_selector('td', text: 'commit message')
|
||||
|
||||
click_link('foldername')
|
||||
|
||||
expect(page).to have_selector('td', text: 'commit message', count: 2)
|
||||
expect(page).to have_selector('td', text: '.gitkeep')
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue