Fixing rspec after upgrade to capybara pt1
This commit is contained in:
parent
2d5096b678
commit
5aeaf248f1
5 changed files with 56 additions and 34 deletions
|
@ -4,7 +4,7 @@
|
||||||
= @snippet.title
|
= @snippet.title
|
||||||
%small= @snippet.file_name
|
%small= @snippet.file_name
|
||||||
- if can?(current_user, :admin_snippet, @project) || @snippet.author == current_user
|
- if can?(current_user, :admin_snippet, @project) || @snippet.author == current_user
|
||||||
= link_to "Edit", edit_project_snippet_path(@project, @snippet), class: "btn btn-small pull-right"
|
= link_to "Edit", edit_project_snippet_path(@project, @snippet), class: "btn btn-small pull-right", title: 'Edit Snippet'
|
||||||
|
|
||||||
%br
|
%br
|
||||||
%div= render 'blob'
|
%div= render 'blob'
|
||||||
|
|
|
@ -169,32 +169,40 @@ describe "Gitlab Flavored Markdown" do
|
||||||
describe "for notes" do
|
describe "for notes" do
|
||||||
it "should render in commits#show", js: true do
|
it "should render in commits#show", js: true do
|
||||||
visit project_commit_path(project, commit)
|
visit project_commit_path(project, commit)
|
||||||
|
within ".new_note.js-main-target-form" do
|
||||||
fill_in "note_note", with: "see ##{issue.id}"
|
fill_in "note_note", with: "see ##{issue.id}"
|
||||||
click_button "Add Comment"
|
click_button "Add Comment"
|
||||||
|
end
|
||||||
|
|
||||||
page.should have_link("##{issue.id}")
|
page.should have_link("##{issue.id}")
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should render in issue#show", js: true do
|
it "should render in issue#show", js: true do
|
||||||
visit project_issue_path(project, issue)
|
visit project_issue_path(project, issue)
|
||||||
|
within ".new_note.js-main-target-form" do
|
||||||
fill_in "note_note", with: "see ##{issue.id}"
|
fill_in "note_note", with: "see ##{issue.id}"
|
||||||
click_button "Add Comment"
|
click_button "Add Comment"
|
||||||
|
end
|
||||||
|
|
||||||
page.should have_link("##{issue.id}")
|
page.should have_link("##{issue.id}")
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should render in merge_request#show", js: true do
|
it "should render in merge_request#show", js: true do
|
||||||
visit project_merge_request_path(project, merge_request)
|
visit project_merge_request_path(project, merge_request)
|
||||||
|
within ".new_note.js-main-target-form" do
|
||||||
fill_in "note_note", with: "see ##{issue.id}"
|
fill_in "note_note", with: "see ##{issue.id}"
|
||||||
click_button "Add Comment"
|
click_button "Add Comment"
|
||||||
|
end
|
||||||
|
|
||||||
page.should have_link("##{issue.id}")
|
page.should have_link("##{issue.id}")
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should render in projects#wall", js: true do
|
it "should render in projects#wall", js: true do
|
||||||
visit wall_project_path(project)
|
visit wall_project_path(project)
|
||||||
|
within ".new_note.js-main-target-form" do
|
||||||
fill_in "note_note", with: "see ##{issue.id}"
|
fill_in "note_note", with: "see ##{issue.id}"
|
||||||
click_button "Add Comment"
|
click_button "Add Comment"
|
||||||
|
end
|
||||||
|
|
||||||
page.should have_link("##{issue.id}")
|
page.should have_link("##{issue.id}")
|
||||||
end
|
end
|
||||||
|
|
|
@ -72,7 +72,7 @@ describe "Snippets" do
|
||||||
author: @user,
|
author: @user,
|
||||||
project: project)
|
project: project)
|
||||||
visit project_snippet_path(project, @snippet)
|
visit project_snippet_path(project, @snippet)
|
||||||
click_link "Edit"
|
click_link "Edit Snippet"
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should open edit page" do
|
it "should open edit page" do
|
||||||
|
|
19
spec/features/users_spec.rb
Normal file
19
spec/features/users_spec.rb
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe 'Users' do
|
||||||
|
describe "GET /users/sign_up" do
|
||||||
|
before do
|
||||||
|
Gitlab.config.gitlab.stub(:signup_enabled).and_return(true)
|
||||||
|
end
|
||||||
|
|
||||||
|
it "should create a new user account" do
|
||||||
|
visit new_user_registration_path
|
||||||
|
fill_in "user_name", with: "Name Surname"
|
||||||
|
fill_in "user_username", with: "Great"
|
||||||
|
fill_in "user_email", with: "name@mail.com"
|
||||||
|
fill_in "user_password", with: "password1234"
|
||||||
|
fill_in "user_password_confirmation", with: "password1234"
|
||||||
|
expect { click_button "Sign up" }.to change {User.count}.by(1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -54,33 +54,28 @@ describe Gitlab::API do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "GET /users/sign_up" do
|
describe "GET /users/sign_up" do
|
||||||
|
context 'enabled' do
|
||||||
|
before do
|
||||||
|
Gitlab.config.gitlab.stub(:signup_enabled).and_return(true)
|
||||||
|
end
|
||||||
|
|
||||||
|
it "should return sign up page if signup is enabled" do
|
||||||
|
get "/users/sign_up"
|
||||||
|
response.status.should == 200
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'disabled' do
|
||||||
before do
|
before do
|
||||||
Gitlab.config.gitlab.stub(:signup_enabled).and_return(false)
|
Gitlab.config.gitlab.stub(:signup_enabled).and_return(false)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should redirect to sign in page if signup is disabled" do
|
it "should redirect to sign in page if signup is disabled" do
|
||||||
get "/users/sign_up"
|
get "/users/sign_up"
|
||||||
response.status.should == 302
|
response.status.should == 302
|
||||||
response.should redirect_to(new_user_session_path)
|
response.should redirect_to(new_user_session_path)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "GET /users/sign_up" do
|
|
||||||
before do
|
|
||||||
Gitlab.config.gitlab.stub(:signup_enabled).and_return(true)
|
|
||||||
end
|
|
||||||
it "should return sign up page if signup is enabled" do
|
|
||||||
get "/users/sign_up"
|
|
||||||
response.status.should == 200
|
|
||||||
end
|
|
||||||
it "should create a new user account" do
|
|
||||||
visit new_user_registration_path
|
|
||||||
fill_in "user_name", with: "Name Surname"
|
|
||||||
fill_in "user_username", with: "Great"
|
|
||||||
fill_in "user_email", with: "name@mail.com"
|
|
||||||
fill_in "user_password", with: "password1234"
|
|
||||||
fill_in "user_password_confirmation", with: "password1234"
|
|
||||||
expect { click_button "Sign up" }.to change {User.count}.by(1)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "PUT /users/:id" do
|
describe "PUT /users/:id" do
|
||||||
|
|
Loading…
Reference in a new issue