Skip to content
Snippets Groups Projects
Commit eb2d6a6e authored by Jose Ivan Vargas Lopez's avatar Jose Ivan Vargas Lopez
Browse files

Fixed rspec tests

parent fc8ec950
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -36,7 +36,7 @@
= text_field_tag 'u2f_registration[name]', nil, class: 'form-control', placeholder: "Pick a name"
.col-md-3
= hidden_field_tag 'u2f_registration[device_response]', nil, class: 'form-control', required: true, id: "js-device-response"
= submit_tag "Register U2F Device", class: "btn btn-success"
= submit_tag "Register U2F device", class: "btn btn-success"
 
:javascript
var u2fRegister = new U2FRegister($("#js-register-u2f"), gon.u2f);
Loading
Loading
Loading
Loading
@@ -41,7 +41,7 @@ describe 'Profile > Personal Access Tokens', feature: true, js: true do
check "api"
check "read_user"
 
click_on "Create Personal Access Token"
click_on "Create personal access token"
expect(active_personal_access_tokens).to have_text(name)
expect(active_personal_access_tokens).to have_text('In')
expect(active_personal_access_tokens).to have_text('api')
Loading
Loading
@@ -54,7 +54,7 @@ describe 'Profile > Personal Access Tokens', feature: true, js: true do
visit profile_personal_access_tokens_path
fill_in "Name", with: 'My PAT'
 
expect { click_on "Create Personal Access Token" }.not_to change { PersonalAccessToken.count }
expect { click_on "Create personal access token" }.not_to change { PersonalAccessToken.count }
expect(page).to have_content("Name cannot be nil")
end
end
Loading
Loading
Loading
Loading
@@ -53,7 +53,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}")
 
fill_in :commit_message, with: 'Add a LICENSE file', visible: true
click_button 'Commit Changes'
click_button 'Commit changes'
 
expect(current_path).to eq(
namespace_project_blob_path(project.namespace, project, 'master/LICENSE'))
Loading
Loading
@@ -63,7 +63,7 @@ feature 'project owner creates a license file', feature: true, js: true do
 
def select_template(template)
page.within('.js-license-selector-wrap') do
click_button 'Apply a License template'
click_button 'Apply a kicense template'
click_link template
wait_for_ajax
end
Loading
Loading
Loading
Loading
@@ -16,7 +16,7 @@ feature 'Master views tags', feature: true do
fill_in :commit_message, with: 'Add a README file', visible: true
# Remove pre-receive hook so we can push without auth
FileUtils.rm_f(File.join(project.repository.path, 'hooks', 'pre-receive'))
click_button 'Commit Changes'
click_button 'Commit changes'
visit namespace_project_tags_path(project.namespace, project)
end
 
Loading
Loading
Loading
Loading
@@ -6,7 +6,7 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do
before { allow_any_instance_of(U2fHelper).to receive(:inject_u2f_api?).and_return(true) }
 
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")
wait_for_ajax
end
Loading
Loading
@@ -34,9 +34,9 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do
 
it 'does not allow registering a new device' do
visit profile_account_path
click_on 'Enable Two-Factor Authentication'
click_on 'Enable two-factor authentication'
 
expect(page).to have_button('Setup New U2F Device', disabled: true)
expect(page).to have_button('Setup new U2F device', disabled: true)
end
end
 
Loading
Loading
@@ -111,9 +111,9 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do
 
# Have the "u2f device" respond with bad data
page.execute_script("u2f.register = function(_,_,_,callback) { callback('bad response'); };")
click_on 'Setup New U2F Device'
click_on 'Setup new U2F device'
expect(page).to have_content('Your device was successfully set up')
click_on 'Register U2F Device'
click_on 'Register U2F device'
 
expect(U2fRegistration.count).to eq(0)
expect(page).to have_content("The form contains the following error")
Loading
Loading
@@ -126,9 +126,9 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do
 
# Failed registration
page.execute_script("u2f.register = function(_,_,_,callback) { callback('bad response'); };")
click_on 'Setup New U2F Device'
click_on 'Setup new U2F device'
expect(page).to have_content('Your device was successfully set up')
click_on 'Register U2F Device'
click_on 'Register U2F device'
expect(page).to have_content("The form contains the following error")
 
# Successful registration
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment