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

Updated failing tests

parent 59955fbb
......@@ -5,13 +5,10 @@
this.Issuable = {
init: function() {
if (!issuable_created) {
issuable_created = true;
Issuable.initTemplates();
Issuable.initSearch();
Issuable.initChecks();
return Issuable.initLabelFilterRemove();
}
Issuable.initTemplates();
Issuable.initSearch();
Issuable.initChecks();
return Issuable.initLabelFilterRemove();
},
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> <% }); %>');
......
......@@ -26,6 +26,7 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps
end
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(find("#merge_request_target_project_id").value).to eq @project.id.to_s
expect(find("input#merge_request_source_branch").value).to eq "fix"
......
class Spinach::Features::EventFilters < Spinach::FeatureSteps
include WaitForAjax
include SharedAuthentication
include SharedPaths
include SharedProject
step 'I should see push event' do
wait_for_ajax
sleep 1
expect(page).to have_selector('span.pushed')
end
step 'I should not see push event' do
wait_for_ajax
save_and_open_screenshot
sleep 1
save_and_open_screenshot
expect(page).not_to have_selector('span.pushed')
save_and_open_screenshot
end
step 'I should see new member event' do
wait_for_ajax
sleep 1
expect(page).to have_selector('span.joined')
end
step 'I should not see new member event' do
wait_for_ajax
sleep 1
expect(page).not_to have_selector('span.joined')
end
step 'I should see merge request event' do
wait_for_ajax
sleep 1
expect(page).to have_selector('span.accepted')
end
step 'I should not see merge request event' do
wait_for_ajax
sleep 1
expect(page).not_to have_selector('span.accepted')
end
......
......@@ -132,6 +132,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
step 'I click on "New file" link in repo' do
find('.add-to-tree').click
click_link 'New file'
expect(page).to have_selector('.file-editor')
end
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