2015-03-22 11:24:23 -04:00
|
|
|
class Spinach::Features::NewProject < Spinach::FeatureSteps
|
|
|
|
include SharedAuthentication
|
|
|
|
include SharedPaths
|
|
|
|
include SharedProject
|
|
|
|
|
2015-10-14 11:26:24 -04:00
|
|
|
step 'I click "New Project" link' do
|
2015-06-12 01:36:00 -04:00
|
|
|
page.within('.content') do
|
2015-10-14 11:26:24 -04:00
|
|
|
click_link "New Project"
|
2015-04-25 14:26:04 -04:00
|
|
|
end
|
2015-03-22 11:24:23 -04:00
|
|
|
end
|
|
|
|
|
2015-10-14 11:26:24 -04:00
|
|
|
step 'I see "New Project" page' do
|
2015-06-18 22:13:32 -04:00
|
|
|
expect(page).to have_content('Project path')
|
2015-03-22 11:24:23 -04:00
|
|
|
end
|
|
|
|
|
2015-08-14 09:56:33 -04:00
|
|
|
step 'I see all possible import optios' do
|
|
|
|
expect(page).to have_link('GitHub')
|
|
|
|
expect(page).to have_link('Bitbucket')
|
|
|
|
expect(page).to have_link('GitLab.com')
|
|
|
|
expect(page).to have_link('Gitorious.org')
|
|
|
|
expect(page).to have_link('Google Code')
|
|
|
|
expect(page).to have_link('Any repo by URL')
|
|
|
|
end
|
|
|
|
|
2015-03-22 11:24:23 -04:00
|
|
|
step 'I click on "Import project from GitHub"' do
|
2015-08-14 09:56:33 -04:00
|
|
|
first('.import_github').click
|
2015-03-22 11:24:23 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
step 'I see instructions on how to import from GitHub' do
|
|
|
|
github_modal = first('.modal-body')
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(github_modal).to be_visible
|
|
|
|
expect(github_modal).to have_content "To enable importing projects from GitHub"
|
2015-03-22 11:24:23 -04:00
|
|
|
|
2015-06-01 17:43:59 -04:00
|
|
|
page.all('.modal-body').each do |element|
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(element).not_to be_visible unless element == github_modal
|
2015-03-22 11:24:23 -04:00
|
|
|
end
|
|
|
|
end
|
2015-08-14 09:56:33 -04:00
|
|
|
|
|
|
|
step 'I click on "Any repo by URL"' do
|
|
|
|
first('.import_git').click
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I see instructions on how to import from Git URL' do
|
|
|
|
git_import_instructions = first('.js-toggle-content')
|
|
|
|
expect(git_import_instructions).to be_visible
|
|
|
|
expect(git_import_instructions).to have_content "Git repository URL"
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I click on "Google Code"' do
|
|
|
|
first('.import_google_code').click
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I redirected to Google Code import page' do
|
|
|
|
expect(current_path).to eq new_import_google_code_path
|
|
|
|
end
|
|
|
|
|
2015-03-22 11:24:23 -04:00
|
|
|
end
|