Commit 6ec561a2 authored by Phil Hughes's avatar Phil Hughes

fixed up specs

parent f8e5941d
...@@ -15,52 +15,52 @@ ...@@ -15,52 +15,52 @@
Update your project name, description, avatar, and other general settings. Update your project name, description, avatar, and other general settings.
.settings-content.no-animate{ class: ('expanded' if expanded) } .settings-content.no-animate{ class: ('expanded' if expanded) }
.project-edit-errors .project-edit-errors
= form_for [@project.namespace.becomes(Namespace), @project], remote: true, html: { multipart: true, class: "edit-project" }, authenticity_token: true do |f| = form_for [@project.namespace.becomes(Namespace), @project], remote: true, html: { multipart: true, class: "edit-project" }, authenticity_token: true do |f|
%fieldset %fieldset
.row .row
.form-group.col-md-9 .form-group.col-md-9
= f.label :name, class: 'label-light', for: 'project_name_edit' do = f.label :name, class: 'label-light', for: 'project_name_edit' do
Project name Project name
= f.text_field :name, class: "form-control", id: "project_name_edit" = f.text_field :name, class: "form-control", id: "project_name_edit"
.form-group.col-md-3 .form-group.col-md-3
= f.label :id, class: 'label-light' do = f.label :id, class: 'label-light' do
Project ID Project ID
= f.text_field :id, class: 'form-control', readonly: true = f.text_field :id, class: 'form-control', readonly: true
.form-group
= f.label :description, class: 'label-light' do
Project description
%span.light (optional)
= f.text_area :description, class: "form-control", rows: 3, maxlength: 250
- unless @project.empty_repo?
.form-group
= f.label :default_branch, "Default Branch", class: 'label-light'
= f.select(:default_branch, @project.repository.branch_names, {}, {class: 'select2 select-wide'})
.form-group .form-group
= f.label :tag_list, "Tags", class: 'label-light' = f.label :description, class: 'label-light' do
= f.text_field :tag_list, value: @project.tag_list.sort.join(', '), maxlength: 2000, class: "form-control" Project description
%p.help-block Separate tags with commas. %span.light (optional)
%fieldset.features = f.text_area :description, class: "form-control", rows: 3, maxlength: 250
%h5.prepend-top-0
Project avatar - unless @project.empty_repo?
.form-group .form-group
- if @project.avatar? = f.label :default_branch, "Default Branch", class: 'label-light'
.avatar-container.s160 = f.select(:default_branch, @project.repository.branch_names, {}, {class: 'select2 select-wide'})
= project_icon(@project.full_path, alt: '', class: 'avatar project-avatar s160') .form-group
%p.light = f.label :tag_list, "Tags", class: 'label-light'
- if @project.avatar_in_git = f.text_field :tag_list, value: @project.tag_list.sort.join(', '), maxlength: 2000, class: "form-control"
Project avatar in repository: #{ @project.avatar_in_git } %p.help-block Separate tags with commas.
%a.choose-btn.btn.js-choose-project-avatar-button %fieldset.features
Browse file... %h5.prepend-top-0
%span.file_name.prepend-left-default.js-avatar-filename No file chosen Project avatar
= f.file_field :avatar, class: "js-project-avatar-input hidden" .form-group
.help-block The maximum file size allowed is 200KB. - if @project.avatar?
- if @project.avatar? .avatar-container.s160
%hr = project_icon(@project.full_path, alt: '', class: 'avatar project-avatar s160')
= link_to 'Remove avatar', project_avatar_path(@project), data: { confirm: "Project avatar will be removed. Are you sure?"}, method: :delete, class: "btn btn-remove btn-sm remove-avatar" %p.light
= f.submit 'Save changes', class: "btn btn-save" - if @project.avatar_in_git
Project avatar in repository: #{ @project.avatar_in_git }
%a.choose-btn.btn.js-choose-project-avatar-button
Browse file...
%span.file_name.prepend-left-default.js-avatar-filename No file chosen
= f.file_field :avatar, class: "js-project-avatar-input hidden"
.help-block The maximum file size allowed is 200KB.
- if @project.avatar?
%hr
= link_to 'Remove avatar', project_avatar_path(@project), data: { confirm: "Project avatar will be removed. Are you sure?"}, method: :delete, class: "btn btn-remove btn-sm remove-avatar"
= f.submit 'Save changes', class: "btn btn-save"
%section.settings.sharing-permissions %section.settings.sharing-permissions
.settings-header .settings-header
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
= expanded ? 'Collapse' : 'Expand' = expanded ? 'Collapse' : 'Expand'
%p %p
Enable or disable certain project features and choose access levels. Enable or disable certain project features and choose access levels.
.settings-content.no-animate{ class: ('expaneded' if expanded) } .settings-content.no-animate{ class: ('expanded' if expanded) }
= form_for [@project.namespace.becomes(Namespace), @project], remote: true, html: { multipart: true, class: "sharing-permissions-form" }, authenticity_token: true do |f| = form_for [@project.namespace.becomes(Namespace), @project], remote: true, html: { multipart: true, class: "sharing-permissions-form" }, authenticity_token: true do |f|
.form_group.sharing-and-permissions .form_group.sharing-and-permissions
.row.js-visibility-select .row.js-visibility-select
...@@ -148,7 +148,7 @@ ...@@ -148,7 +148,7 @@
= f.submit 'Save changes', class: "btn btn-save" = f.submit 'Save changes', class: "btn btn-save"
%section.settings.merge-request-settings{ style: ("display: none;" if @project.project_feature.send(:merge_requests_access_level) == 0) } %section.settings.merge-requests-feature{ style: ("display: none;" if @project.project_feature.send(:merge_requests_access_level) == 0) }
.settings-header .settings-header
%h4 %h4
Merge request settings Merge request settings
......
...@@ -10,7 +10,9 @@ class Spinach::Features::Project < Spinach::FeatureSteps ...@@ -10,7 +10,9 @@ class Spinach::Features::Project < Spinach::FeatureSteps
end end
step 'I save project' do step 'I save project' do
click_button 'Save changes' page.within '.general-settings' do
click_button 'Save changes'
end
end end
step 'I should see project with new settings' do step 'I should see project with new settings' do
...@@ -31,7 +33,9 @@ class Spinach::Features::Project < Spinach::FeatureSteps ...@@ -31,7 +33,9 @@ class Spinach::Features::Project < Spinach::FeatureSteps
:project_avatar, :project_avatar,
File.join(Rails.root, 'spec', 'fixtures', 'banana_sample.gif') File.join(Rails.root, 'spec', 'fixtures', 'banana_sample.gif')
) )
click_button 'Save changes' page.within '.general-settings' do
click_button 'Save changes'
end
@project.reload @project.reload
end end
...@@ -50,7 +54,9 @@ class Spinach::Features::Project < Spinach::FeatureSteps ...@@ -50,7 +54,9 @@ class Spinach::Features::Project < Spinach::FeatureSteps
:project_avatar, :project_avatar,
File.join(Rails.root, 'spec', 'fixtures', 'banana_sample.gif') File.join(Rails.root, 'spec', 'fixtures', 'banana_sample.gif')
) )
click_button 'Save changes' page.within '.general-settings' do
click_button 'Save changes'
end
@project.reload @project.reload
end end
...@@ -69,7 +75,9 @@ class Spinach::Features::Project < Spinach::FeatureSteps ...@@ -69,7 +75,9 @@ class Spinach::Features::Project < Spinach::FeatureSteps
step 'change project default branch' do step 'change project default branch' do
select 'fix', from: 'project_default_branch' select 'fix', from: 'project_default_branch'
click_button 'Save changes' page.within '.general-settings' do
click_button 'Save changes'
end
end end
step 'I should see project default branch changed' do step 'I should see project default branch changed' do
......
...@@ -103,7 +103,7 @@ module SharedProject ...@@ -103,7 +103,7 @@ module SharedProject
step 'I should see project settings' do step 'I should see project settings' do
expect(current_path).to eq edit_project_path(@project) expect(current_path).to eq edit_project_path(@project)
expect(page).to have_content("Project name") expect(page).to have_content("Project name")
expect(page).to have_content("Sharing & Permissions") expect(page).to have_content("Sharing and permissions")
end end
def current_project def current_project
......
...@@ -39,8 +39,6 @@ describe 'Edit Project Settings' do ...@@ -39,8 +39,6 @@ describe 'Edit Project Settings' do
end end
wait_for_requests wait_for_requests
expect(page).to have_selector(".shortcuts-#{shortcut_name}") expect(page).to have_selector(".shortcuts-#{shortcut_name}")
sleep 0.1
end end
end end
end end
...@@ -180,7 +178,11 @@ describe 'Edit Project Settings' do ...@@ -180,7 +178,11 @@ describe 'Edit Project Settings' do
it "disables repository related features" do it "disables repository related features" do
select "Disabled", from: "project_project_feature_attributes_repository_access_level" select "Disabled", from: "project_project_feature_attributes_repository_access_level"
expect(find(".edit-project")).to have_selector("select.disabled", count: 2) page.within('.sharing-permissions') do
click_button "Save changes"
end
expect(find(".sharing-permissions")).to have_selector("select.disabled", count: 2)
end end
it "shows empty features project homepage" do it "shows empty features project homepage" do
...@@ -188,7 +190,9 @@ describe 'Edit Project Settings' do ...@@ -188,7 +190,9 @@ describe 'Edit Project Settings' do
select "Disabled", from: "project_project_feature_attributes_issues_access_level" select "Disabled", from: "project_project_feature_attributes_issues_access_level"
select "Disabled", from: "project_project_feature_attributes_wiki_access_level" select "Disabled", from: "project_project_feature_attributes_wiki_access_level"
click_button "Save changes" page.within('.sharing-permissions') do
click_button "Save changes"
end
wait_for_requests wait_for_requests
visit project_path(project) visit project_path(project)
...@@ -201,7 +205,9 @@ describe 'Edit Project Settings' do ...@@ -201,7 +205,9 @@ describe 'Edit Project Settings' do
select "Disabled", from: "project_project_feature_attributes_issues_access_level" select "Disabled", from: "project_project_feature_attributes_issues_access_level"
select "Disabled", from: "project_project_feature_attributes_wiki_access_level" select "Disabled", from: "project_project_feature_attributes_wiki_access_level"
click_button "Save changes" page.within('.sharing-permissions') do
click_button "Save changes"
end
wait_for_requests wait_for_requests
visit activity_project_path(project) visit activity_project_path(project)
...@@ -242,7 +248,9 @@ describe 'Edit Project Settings' do ...@@ -242,7 +248,9 @@ describe 'Edit Project Settings' do
end end
def save_changes_and_check_activity_tab def save_changes_and_check_activity_tab
click_button "Save changes" page.within('.sharing-permissions') do
click_button "Save changes"
end
wait_for_requests wait_for_requests
visit activity_project_path(project) visit activity_project_path(project)
......
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