Merge branch 'replase_spinach_spec_create.feature' into 'master'

Replace 'create.feature' spinach test with an rspec analog

See merge request !12343
This commit is contained in:
Rémy Coutable 2017-06-21 12:20:50 +00:00
commit f96562b107
3 changed files with 31 additions and 14 deletions

View File

@ -0,0 +1,4 @@
---
title: Replace 'create.feature' spinach test with an rspec analog
merge_request: 12343
author: @blackst0ne

View File

@ -1,14 +0,0 @@
@project-create
Feature: Project Create
In order to get access to project sections
A user with ability to create a project
Should be able to create a new one
@javascript
Scenario: User create a project
Given I sign in as a user
And I have an ssh key
When I visit new project page
And fill project form with valid data
Then I should see project page
And I should see empty project instructions

View File

@ -0,0 +1,27 @@
require 'spec_helper'
feature 'User creates a project', js: true do
let(:user) { create(:user) }
before do
sign_in(user)
create(:personal_key, user: user)
visit(new_project_path)
end
it 'creates a new project' do
fill_in(:project_path, with: 'Empty')
page.within('#content-body') do
click_button('Create project')
end
project = Project.last
expect(current_path).to eq(namespace_project_path(project.namespace, project))
expect(page).to have_content('Empty')
expect(page).to have_content('git init')
expect(page).to have_content('git remote')
expect(page).to have_content(project.url_to_repo)
end
end