Commit 61bdc80d authored by Phil Hughes's avatar Phil Hughes Committed by Alfredo Sumaran

Updated failing tests

parent 59955fbb
...@@ -5,13 +5,10 @@ ...@@ -5,13 +5,10 @@
this.Issuable = { this.Issuable = {
init: function() { init: function() {
if (!issuable_created) { Issuable.initTemplates();
issuable_created = true; Issuable.initSearch();
Issuable.initTemplates(); Issuable.initChecks();
Issuable.initSearch(); return Issuable.initLabelFilterRemove();
Issuable.initChecks();
return Issuable.initLabelFilterRemove();
}
}, },
initTemplates: function() { initTemplates: function() {
return Issuable.labelRow = _.template('<% _.each(labels, function(label){ %> <span class="label-row btn-group" role="group" aria-label="<%- label.title %>" style="color: <%- label.text_color %>;"> <a href="#" class="btn btn-transparent has-tooltip" style="background-color: <%- label.color %>;" title="<%- label.description %>" data-container="body"> <%- label.title %> </a> <button type="button" class="btn btn-transparent label-remove js-label-filter-remove" style="background-color: <%- label.color %>;" data-label="<%- label.title %>"> <i class="fa fa-times"></i> </button> </span> <% }); %>'); return Issuable.labelRow = _.template('<% _.each(labels, function(label){ %> <span class="label-row btn-group" role="group" aria-label="<%- label.title %>" style="color: <%- label.text_color %>;"> <a href="#" class="btn btn-transparent has-tooltip" style="background-color: <%- label.color %>;" title="<%- label.description %>" data-container="body"> <%- label.title %> </a> <button type="button" class="btn btn-transparent label-remove js-label-filter-remove" style="background-color: <%- label.color %>;" data-label="<%- label.title %>"> <i class="fa fa-times"></i> </button> </span> <% }); %>');
......
...@@ -26,6 +26,7 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps ...@@ -26,6 +26,7 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps
end end
step 'I see prefilled new Merge Request page' do step 'I see prefilled new Merge Request page' do
expect(page).to have_selector('.merge-request-form')
expect(current_path).to eq new_namespace_project_merge_request_path(@project.namespace, @project) expect(current_path).to eq new_namespace_project_merge_request_path(@project.namespace, @project)
expect(find("#merge_request_target_project_id").value).to eq @project.id.to_s expect(find("#merge_request_target_project_id").value).to eq @project.id.to_s
expect(find("input#merge_request_source_branch").value).to eq "fix" expect(find("input#merge_request_source_branch").value).to eq "fix"
......
class Spinach::Features::EventFilters < Spinach::FeatureSteps class Spinach::Features::EventFilters < Spinach::FeatureSteps
include WaitForAjax
include SharedAuthentication include SharedAuthentication
include SharedPaths include SharedPaths
include SharedProject include SharedProject
step 'I should see push event' do step 'I should see push event' do
wait_for_ajax
sleep 1 sleep 1
expect(page).to have_selector('span.pushed') expect(page).to have_selector('span.pushed')
end end
step 'I should not see push event' do step 'I should not see push event' do
wait_for_ajax
save_and_open_screenshot
sleep 1 sleep 1
save_and_open_screenshot
expect(page).not_to have_selector('span.pushed') expect(page).not_to have_selector('span.pushed')
save_and_open_screenshot
end end
step 'I should see new member event' do step 'I should see new member event' do
wait_for_ajax
sleep 1 sleep 1
expect(page).to have_selector('span.joined') expect(page).to have_selector('span.joined')
end end
step 'I should not see new member event' do step 'I should not see new member event' do
wait_for_ajax
sleep 1 sleep 1
expect(page).not_to have_selector('span.joined') expect(page).not_to have_selector('span.joined')
end end
step 'I should see merge request event' do step 'I should see merge request event' do
wait_for_ajax
sleep 1 sleep 1
expect(page).to have_selector('span.accepted') expect(page).to have_selector('span.accepted')
end end
step 'I should not see merge request event' do step 'I should not see merge request event' do
wait_for_ajax
sleep 1 sleep 1
expect(page).not_to have_selector('span.accepted') expect(page).not_to have_selector('span.accepted')
end end
......
...@@ -132,6 +132,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps ...@@ -132,6 +132,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
step 'I click on "New file" link in repo' do step 'I click on "New file" link in repo' do
find('.add-to-tree').click find('.add-to-tree').click
click_link 'New file' click_link 'New file'
expect(page).to have_selector('.file-editor')
end end
step 'I click on "Upload file" link in repo' do step 'I click on "Upload file" link in repo' do
......
module WaitForAjax
def wait_for_ajax
Timeout.timeout(Capybara.default_max_wait_time) do
loop until finished_all_ajax_requests?
end
end
def finished_all_ajax_requests?
page.evaluate_script('jQuery.active').zero?
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