Commit 5e1b7e4f authored by Michael Kozono's avatar Michael Kozono

Refactor and rename specs

parent 19e0d36e
require 'spec_helper'
feature 'Projects > Members > Anonymous user sees members', js: true do
feature 'Projects > Members > Groups with access list', js: true do
let(:user) { create(:user) }
let(:group) { create(:group, :public) }
let(:project) { create(:project, :public) }
......@@ -13,7 +13,7 @@ feature 'Projects > Members > Anonymous user sees members', js: true do
visit project_settings_members_path(project)
end
it 'updates group access level' do
scenario 'updates group access level' do
click_button @group_link.human_access
page.within '.dropdown-menu' do
......@@ -27,7 +27,7 @@ feature 'Projects > Members > Anonymous user sees members', js: true do
expect(first('.group_member')).to have_content('Guest')
end
it 'updates expiry date' do
scenario 'updates expiry date' do
tomorrow = Date.today + 3
fill_in "member_expires_at_#{group.id}", with: tomorrow.strftime("%F")
......@@ -38,7 +38,7 @@ feature 'Projects > Members > Anonymous user sees members', js: true do
end
end
it 'deletes group link' do
scenario 'deletes group link' do
page.within(first('.group_member')) do
find('.btn-remove').click
end
......@@ -47,8 +47,8 @@ feature 'Projects > Members > Anonymous user sees members', js: true do
expect(page).not_to have_selector('.group_member')
end
context 'search' do
it 'finds no results' do
context 'search in existing members (yes, this filters the groups list as well)' do
scenario 'finds no results' do
page.within '.member-search-form' do
fill_in 'search', with: 'testing 123'
find('.member-search-btn').click
......@@ -57,7 +57,7 @@ feature 'Projects > Members > Anonymous user sees members', js: true do
expect(page).not_to have_selector('.group_member')
end
it 'finds results' do
scenario 'finds results' do
page.within '.member-search-form' do
fill_in 'search', with: group.name
find('.member-search-btn').click
......
require 'spec_helper'
feature 'Project group links', :js do
feature 'Project > Members > Share with Group', :js do
include Select2Helper
let(:master) { create(:user) }
......@@ -12,7 +12,7 @@ feature 'Project group links', :js do
sign_in(master)
end
context 'setting an expiration date for a group link' do
context 'after setting an expiration date for a group link' do
before do
visit project_settings_members_path(project)
......@@ -24,7 +24,7 @@ feature 'Project group links', :js do
find('.btn-create').trigger('click')
end
it 'shows the expiration time with a warning class' do
scenario 'the group link shows the expiration time with a warning class' do
page.within('.project-members-groups') do
expect(page).to have_content('Expires in 4 days')
expect(page).to have_selector('.text-warning')
......@@ -32,7 +32,7 @@ feature 'Project group links', :js do
end
end
context 'nested group project' do
context 'for a project in a nested group' do
let!(:nested_group) { create(:group, parent: group) }
let!(:another_group) { create(:group) }
let!(:project) { create(:project, namespace: nested_group) }
......@@ -42,7 +42,7 @@ feature 'Project group links', :js do
another_group.add_master(master)
end
it 'does not show ancestors', :nested_groups do
scenario 'the groups dropdown does not show ancestors', :nested_groups do
visit project_settings_members_path(project)
click_on 'share-with-group-tab'
......
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