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

fixed up specs

parent f8e5941d
......@@ -70,7 +70,7 @@
= expanded ? 'Collapse' : 'Expand'
%p
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_group.sharing-and-permissions
.row.js-visibility-select
......@@ -148,7 +148,7 @@
= 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
%h4
Merge request settings
......
......@@ -10,8 +10,10 @@ class Spinach::Features::Project < Spinach::FeatureSteps
end
step 'I save project' do
page.within '.general-settings' do
click_button 'Save changes'
end
end
step 'I should see project with new settings' do
expect(find_field('project_name').value).to eq 'NewName'
......@@ -31,7 +33,9 @@ class Spinach::Features::Project < Spinach::FeatureSteps
:project_avatar,
File.join(Rails.root, 'spec', 'fixtures', 'banana_sample.gif')
)
page.within '.general-settings' do
click_button 'Save changes'
end
@project.reload
end
......@@ -50,7 +54,9 @@ class Spinach::Features::Project < Spinach::FeatureSteps
:project_avatar,
File.join(Rails.root, 'spec', 'fixtures', 'banana_sample.gif')
)
page.within '.general-settings' do
click_button 'Save changes'
end
@project.reload
end
......@@ -69,8 +75,10 @@ class Spinach::Features::Project < Spinach::FeatureSteps
step 'change project default branch' do
select 'fix', from: 'project_default_branch'
page.within '.general-settings' do
click_button 'Save changes'
end
end
step 'I should see project default branch changed' do
expect(find(:css, 'select#project_default_branch').value).to eq 'fix'
......
......@@ -103,7 +103,7 @@ module SharedProject
step 'I should see project settings' do
expect(current_path).to eq edit_project_path(@project)
expect(page).to have_content("Project name")
expect(page).to have_content("Sharing & Permissions")
expect(page).to have_content("Sharing and permissions")
end
def current_project
......
......@@ -39,8 +39,6 @@ describe 'Edit Project Settings' do
end
wait_for_requests
expect(page).to have_selector(".shortcuts-#{shortcut_name}")
sleep 0.1
end
end
end
......@@ -180,7 +178,11 @@ describe 'Edit Project Settings' do
it "disables repository related features" do
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
it "shows empty features project homepage" 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_wiki_access_level"
page.within('.sharing-permissions') do
click_button "Save changes"
end
wait_for_requests
visit project_path(project)
......@@ -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_wiki_access_level"
page.within('.sharing-permissions') do
click_button "Save changes"
end
wait_for_requests
visit activity_project_path(project)
......@@ -242,7 +248,9 @@ describe 'Edit Project Settings' do
end
def save_changes_and_check_activity_tab
page.within('.sharing-permissions') do
click_button "Save changes"
end
wait_for_requests
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