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

Refactor and rename specs

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