Commit e2bcb3a4 authored by Phil Hughes's avatar Phil Hughes

fixed specs

parent 4119e92b
...@@ -60,7 +60,7 @@ class Projects::RefsController < Projects::ApplicationController ...@@ -60,7 +60,7 @@ class Projects::RefsController < Projects::ApplicationController
file_name: content.name, file_name: content.name,
commit: last_commit, commit: last_commit,
type: content.type, 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
end end
......
...@@ -19,13 +19,13 @@ describe Projects::RefsController do ...@@ -19,13 +19,13 @@ describe Projects::RefsController do
format: format format: format
end end
def xhr_get(format = :html, path = 'foo/bar/baz.html') def xhr_get(format = :html)
xhr :get, xhr :get,
:logs_tree, :logs_tree,
namespace_id: project.namespace.to_param, namespace_id: project.namespace.to_param,
project_id: project, project_id: project,
id: 'master', id: 'master',
path: path, path: 'foo/bar/baz.html',
format: format format: format
end end
...@@ -47,12 +47,10 @@ describe Projects::RefsController do ...@@ -47,12 +47,10 @@ describe Projects::RefsController do
end end
it 'renders JSON' do it 'renders JSON' do
xhr_get(:json, '/') xhr_get(:json)
expect(response).to be_success expect(response).to be_success
expect(json_response).to be_kind_of(Array) 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 end
end end
...@@ -31,10 +31,5 @@ feature 'Multi-file editor new directory', :js do ...@@ -31,10 +31,5 @@ feature 'Multi-file editor new directory', :js do
click_button('Commit 1 file') click_button('Commit 1 file')
expect(page).to have_selector('td', text: 'commit message') 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
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment