Commit 7592137f authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

Fix rspec and spinach tests

parent 0e325ea6
.form-actions .form-actions
= button_tag 'Commit Changes', class: 'btn commit-btn js-commit-button btn-create' = button_tag 'Commit changes', class: 'btn commit-btn js-commit-button btn-create'
= link_to 'Cancel', cancel_path, = link_to 'Cancel', cancel_path,
class: 'btn btn-cancel', data: {confirm: leave_edit_message} class: 'btn btn-cancel', data: {confirm: leave_edit_message}
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
.template-type-selector.js-template-type-selector-wrap.hidden .template-type-selector.js-template-type-selector-wrap.hidden
= dropdown_tag("Choose type", options: { toggle_class: 'btn js-template-type-selector', title: "Choose a template type" } ) = dropdown_tag("Choose type", options: { toggle_class: 'btn js-template-type-selector', title: "Choose a template type" } )
.license-selector.js-license-selector-wrap.js-template-selector-wrap.hidden .license-selector.js-license-selector-wrap.js-template-selector-wrap.hidden
= dropdown_tag("Apply a License template", options: { toggle_class: 'btn js-license-selector', title: "Apply a license", filter: true, placeholder: "Filter", data: { data: licenses_for_select, project: @project.name, fullname: @project.namespace.human_name } } ) = dropdown_tag("Apply a license template", options: { toggle_class: 'btn js-license-selector', title: "Apply a license", filter: true, placeholder: "Filter", data: { data: licenses_for_select, project: @project.name, fullname: @project.namespace.human_name } } )
.gitignore-selector.js-gitignore-selector-wrap.js-template-selector-wrap.hidden .gitignore-selector.js-gitignore-selector-wrap.js-template-selector-wrap.hidden
= dropdown_tag("Apply a .gitignore template", options: { toggle_class: 'btn js-gitignore-selector', title: "Apply a template", filter: true, placeholder: "Filter", data: { data: gitignore_names } } ) = dropdown_tag("Apply a .gitignore template", options: { toggle_class: 'btn js-gitignore-selector', title: "Apply a template", filter: true, placeholder: "Filter", data: { data: gitignore_names } } )
.gitlab-ci-yml-selector.js-gitlab-ci-yml-selector-wrap.js-template-selector-wrap.hidden .gitlab-ci-yml-selector.js-gitlab-ci-yml-selector-wrap.js-template-selector-wrap.hidden
......
- type = impersonation ? "impersonation" : "personal Access" - type = impersonation ? "impersonation" : "personal access"
%h5.prepend-top-0 %h5.prepend-top-0
Add a #{type} Token Add a #{type} Token
......
...@@ -36,7 +36,7 @@ Feature: Project Source Browse Files ...@@ -36,7 +36,7 @@ Feature: Project Source Browse Files
And I edit code And I edit code
And I fill the new file name And I fill the new file name
And I fill the commit message And I fill the commit message
And I click on "Commit Changes" And I click on "Commit changes"
Then I am redirected to the new file Then I am redirected to the new file
And I should see its new content And I should see its new content
...@@ -47,7 +47,7 @@ Feature: Project Source Browse Files ...@@ -47,7 +47,7 @@ Feature: Project Source Browse Files
And I edit code And I edit code
And I fill the new file name And I fill the new file name
And I fill the commit message And I fill the commit message
And I click on "Commit Changes" And I click on "Commit changes"
Then I am redirected to the fork's new merge request page Then I am redirected to the fork's new merge request page
And I can see the new commit message And I can see the new commit message
...@@ -57,7 +57,7 @@ Feature: Project Source Browse Files ...@@ -57,7 +57,7 @@ Feature: Project Source Browse Files
And I edit code with new lines at end of file And I edit code with new lines at end of file
And I fill the new file name And I fill the new file name
And I fill the commit message And I fill the commit message
And I click on "Commit Changes" And I click on "Commit changes"
Then I am redirected to the new file Then I am redirected to the new file
And I click button "Edit" And I click button "Edit"
And I should see its content with new lines preserved at end of file And I should see its content with new lines preserved at end of file
...@@ -69,7 +69,7 @@ Feature: Project Source Browse Files ...@@ -69,7 +69,7 @@ Feature: Project Source Browse Files
And I fill the new file name And I fill the new file name
And I fill the commit message And I fill the commit message
And I fill the new branch name And I fill the new branch name
And I click on "Commit Changes" And I click on "Commit changes"
Then I am redirected to the new merge request page Then I am redirected to the new merge request page
When I click on "Changes" tab When I click on "Changes" tab
And I should see its new content And I should see its new content
...@@ -173,7 +173,7 @@ Feature: Project Source Browse Files ...@@ -173,7 +173,7 @@ Feature: Project Source Browse Files
And I click button "Edit" And I click button "Edit"
And I edit code And I edit code
And I fill the commit message And I fill the commit message
And I click on "Commit Changes" And I click on "Commit changes"
Then I am redirected to the ".gitignore" Then I am redirected to the ".gitignore"
And I should see its new content And I should see its new content
...@@ -186,7 +186,7 @@ Feature: Project Source Browse Files ...@@ -186,7 +186,7 @@ Feature: Project Source Browse Files
And I click button "Fork" And I click button "Fork"
And I edit code And I edit code
And I fill the commit message And I fill the commit message
And I click on "Commit Changes" And I click on "Commit changes"
Then I am redirected to the fork's new merge request page Then I am redirected to the fork's new merge request page
And I can see the new commit message And I can see the new commit message
...@@ -197,7 +197,7 @@ Feature: Project Source Browse Files ...@@ -197,7 +197,7 @@ Feature: Project Source Browse Files
And I edit code And I edit code
And I fill the commit message And I fill the commit message
And I fill the new branch name And I fill the new branch name
And I click on "Commit Changes" And I click on "Commit changes"
Then I am redirected to the new merge request page Then I am redirected to the new merge request page
Then I click on "Changes" tab Then I click on "Changes" tab
And I should see its new content And I should see its new content
......
...@@ -18,11 +18,11 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps ...@@ -18,11 +18,11 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps
step 'I should see last push widget' do step 'I should see last push widget' do
expect(page).to have_content "You pushed to fix" expect(page).to have_content "You pushed to fix"
expect(page).to have_link "Create Merge Request" expect(page).to have_link "Create merge request"
end end
step 'I click "Create Merge Request" link' do step 'I click "Create merge request" link' do
click_link "Create Merge Request" click_link "Create merge request"
end end
step 'I see prefilled new Merge Request page' do step 'I see prefilled new Merge Request page' do
......
...@@ -108,8 +108,8 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps ...@@ -108,8 +108,8 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
click_link 'Preview Changes' click_link 'Preview Changes'
end end
step 'I click on "Commit Changes"' do step 'I click on "Commit changes"' do
click_button 'Commit Changes' click_button 'Commit changes'
end end
step 'I click on "Changes" tab' do step 'I click on "Changes" tab' do
......
...@@ -30,7 +30,7 @@ describe 'Admin > Users > Impersonation Tokens', feature: true, js: true do ...@@ -30,7 +30,7 @@ describe 'Admin > Users > Impersonation Tokens', feature: true, js: true do
check "api" check "api"
check "read_user" check "read_user"
expect { click_on "Create Impersonation Token" }.to change { PersonalAccessTokensFinder.new(impersonation: true).execute.count } expect { click_on "Create impersonation token" }.to change { PersonalAccessTokensFinder.new(impersonation: true).execute.count }
expect(active_impersonation_tokens).to have_text(name) expect(active_impersonation_tokens).to have_text(name)
expect(active_impersonation_tokens).to have_text('In') expect(active_impersonation_tokens).to have_text('In')
expect(active_impersonation_tokens).to have_text('api') expect(active_impersonation_tokens).to have_text('api')
......
...@@ -56,7 +56,7 @@ describe 'Auto deploy' do ...@@ -56,7 +56,7 @@ describe 'Auto deploy' do
click_on 'OpenShift' click_on 'OpenShift'
end end
wait_for_ajax wait_for_ajax
click_button 'Commit Changes' click_button 'Commit changes'
expect(page).to have_content('New Merge Request From auto-deploy into master') expect(page).to have_content('New Merge Request From auto-deploy into master')
end end
......
...@@ -22,7 +22,7 @@ feature 'Editing file blob', feature: true, js: true do ...@@ -22,7 +22,7 @@ feature 'Editing file blob', feature: true, js: true do
wait_for_ajax wait_for_ajax
find('.js-edit-blob').click find('.js-edit-blob').click
execute_script('ace.edit("editor").setValue("class NextFeature\nend\n")') execute_script('ace.edit("editor").setValue("class NextFeature\nend\n")')
click_button 'Commit Changes' click_button 'Commit changes'
end end
context 'from MR diff' do context 'from MR diff' do
......
...@@ -22,7 +22,7 @@ feature 'New blob creation', feature: true, js: true do ...@@ -22,7 +22,7 @@ feature 'New blob creation', feature: true, js: true do
end end
def commit_file def commit_file
click_button 'Commit Changes' click_button 'Commit changes'
end end
context 'with default target branch' do context 'with default target branch' do
......
...@@ -19,7 +19,7 @@ feature 'User wants to create a file', feature: true do ...@@ -19,7 +19,7 @@ feature 'User wants to create a file', feature: true do
file_content = find('#file-content') file_content = find('#file-content')
file_content.set options[:file_content] || 'Some content' file_content.set options[:file_content] || 'Some content'
click_button 'Commit Changes' click_button 'Commit changes'
end end
scenario 'file name contains Chinese characters' do scenario 'file name contains Chinese characters' do
......
...@@ -27,7 +27,7 @@ feature 'User wants to edit a file', feature: true do ...@@ -27,7 +27,7 @@ feature 'User wants to edit a file', feature: true do
scenario 'file has been updated since the user opened the edit page' do scenario 'file has been updated since the user opened the edit page' do
Files::UpdateService.new(project, user, commit_params).execute Files::UpdateService.new(project, user, commit_params).execute
click_button 'Commit Changes' click_button 'Commit changes'
expect(page).to have_content 'Someone edited the file the same time you did.' expect(page).to have_content 'Someone edited the file the same time you did.'
end end
......
...@@ -29,7 +29,7 @@ feature 'project owner creates a license file', feature: true, js: true do ...@@ -29,7 +29,7 @@ feature 'project owner creates a license file', feature: true, js: true do
expect(file_content).to have_content("Copyright (c) #{Time.now.year} #{project.namespace.human_name}") expect(file_content).to have_content("Copyright (c) #{Time.now.year} #{project.namespace.human_name}")
fill_in :commit_message, with: 'Add a LICENSE file', visible: true fill_in :commit_message, with: 'Add a LICENSE file', visible: true
click_button 'Commit Changes' click_button 'Commit changes'
expect(current_path).to eq( expect(current_path).to eq(
namespace_project_blob_path(project.namespace, project, 'master/LICENSE')) namespace_project_blob_path(project.namespace, project, 'master/LICENSE'))
...@@ -63,7 +63,7 @@ feature 'project owner creates a license file', feature: true, js: true do ...@@ -63,7 +63,7 @@ feature 'project owner creates a license file', feature: true, js: true do
def select_template(template) def select_template(template)
page.within('.js-license-selector-wrap') do page.within('.js-license-selector-wrap') do
click_button 'Apply a kicense template' click_button 'Apply a license template'
click_link template click_link template
wait_for_ajax wait_for_ajax
end end
......
...@@ -30,7 +30,7 @@ feature 'project owner sees a link to create a license file in empty project', f ...@@ -30,7 +30,7 @@ feature 'project owner sees a link to create a license file in empty project', f
fill_in :commit_message, with: 'Add a LICENSE file', visible: true fill_in :commit_message, with: 'Add a LICENSE file', visible: true
# Remove pre-receive hook so we can push without auth # Remove pre-receive hook so we can push without auth
FileUtils.rm_f(File.join(project.repository.path, 'hooks', 'pre-receive')) FileUtils.rm_f(File.join(project.repository.path, 'hooks', 'pre-receive'))
click_button 'Commit Changes' click_button 'Commit changes'
expect(current_path).to eq( expect(current_path).to eq(
namespace_project_blob_path(project.namespace, project, 'master/LICENSE')) namespace_project_blob_path(project.namespace, project, 'master/LICENSE'))
...@@ -40,7 +40,7 @@ feature 'project owner sees a link to create a license file in empty project', f ...@@ -40,7 +40,7 @@ feature 'project owner sees a link to create a license file in empty project', f
def select_template(template) def select_template(template)
page.within('.js-license-selector-wrap') do page.within('.js-license-selector-wrap') do
click_button 'Apply a License template' click_button 'Apply a license template'
click_link template click_link template
wait_for_ajax wait_for_ajax
end end
......
...@@ -102,7 +102,7 @@ def check_type_selector_display(is_visible) ...@@ -102,7 +102,7 @@ def check_type_selector_display(is_visible)
end end
def try_selecting_all_types def try_selecting_all_types
try_selecting_template_type('LICENSE', 'Apply a License template') try_selecting_template_type('LICENSE', 'Apply a license template')
try_selecting_template_type('Dockerfile', 'Apply a Dockerfile template') try_selecting_template_type('Dockerfile', 'Apply a Dockerfile template')
try_selecting_template_type('.gitlab-ci.yml', 'Apply a GitLab CI Yaml template') try_selecting_template_type('.gitlab-ci.yml', 'Apply a GitLab CI Yaml template')
try_selecting_template_type('.gitignore', 'Apply a .gitignore template') try_selecting_template_type('.gitignore', 'Apply a .gitignore template')
...@@ -130,6 +130,6 @@ end ...@@ -130,6 +130,6 @@ end
def create_and_edit_file(file_name) def create_and_edit_file(file_name)
visit namespace_project_new_blob_path(project.namespace, project, 'master', file_name: file_name) visit namespace_project_new_blob_path(project.namespace, project, 'master', file_name: file_name)
click_button "Commit Changes" click_button "Commit changes"
visit namespace_project_edit_blob_path(project.namespace, project, File.join(project.default_branch, file_name)) visit namespace_project_edit_blob_path(project.namespace, project, File.join(project.default_branch, file_name))
end end
...@@ -17,7 +17,7 @@ feature 'Template Undo Button', js: true do ...@@ -17,7 +17,7 @@ feature 'Template Undo Button', js: true do
end end
scenario 'reverts template application' do scenario 'reverts template application' do
try_template_undo('http://www.apache.org/licenses/', 'Apply a License template') try_template_undo('http://www.apache.org/licenses/', 'Apply a license template')
end end
end end
...@@ -29,7 +29,7 @@ feature 'Template Undo Button', js: true do ...@@ -29,7 +29,7 @@ feature 'Template Undo Button', js: true do
end end
scenario 'reverts template application' do scenario 'reverts template application' do
try_template_undo('http://www.apache.org/licenses/', 'Apply a License template') try_template_undo('http://www.apache.org/licenses/', 'Apply a license template')
end end
end end
end end
......
...@@ -7,17 +7,17 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do ...@@ -7,17 +7,17 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do
def manage_two_factor_authentication def manage_two_factor_authentication
click_on 'Manage two-factor authentication' click_on 'Manage two-factor authentication'
expect(page).to have_content("Setup New U2F Device") expect(page).to have_content("Setup new U2F device")
wait_for_ajax wait_for_ajax
end end
def register_u2f_device(u2f_device = nil, name: 'My device') def register_u2f_device(u2f_device = nil, name: 'My device')
u2f_device ||= FakeU2fDevice.new(page, name) u2f_device ||= FakeU2fDevice.new(page, name)
u2f_device.respond_to_u2f_registration u2f_device.respond_to_u2f_registration
click_on 'Setup New U2F Device' click_on 'Setup new U2F device'
expect(page).to have_content('Your device was successfully set up') expect(page).to have_content('Your device was successfully set up')
fill_in "Pick a name", with: name fill_in "Pick a name", with: name
click_on 'Register U2F Device' click_on 'Register U2F device'
u2f_device u2f_device
end end
......
...@@ -22,7 +22,7 @@ require('./mock_u2f_device'); ...@@ -22,7 +22,7 @@ require('./mock_u2f_device');
it('allows registering a U2F device', function() { it('allows registering a U2F device', function() {
var deviceResponse, inProgressMessage, registeredMessage, setupButton; var deviceResponse, inProgressMessage, registeredMessage, setupButton;
setupButton = this.container.find("#js-setup-u2f-device"); setupButton = this.container.find("#js-setup-u2f-device");
expect(setupButton.text()).toBe('Setup New U2F Device'); expect(setupButton.text()).toBe('Setup new U2F device');
setupButton.trigger('click'); setupButton.trigger('click');
inProgressMessage = this.container.children("p"); inProgressMessage = this.container.children("p");
expect(inProgressMessage.text()).toContain("Trying to communicate with your device"); expect(inProgressMessage.text()).toContain("Trying to communicate with your device");
......
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