Commit 7545290d authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Move audit tests for project in separate class

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 376bf540
......@@ -11,4 +11,13 @@ Feature: Audit Event
And I visit audit event page
Then I see remove deploy key event
\ No newline at end of file
@javascript
Scenario: I should see audit events
And gitlab user "Pete"
And "Pete" is "Shop" developer
When I visit project "Shop" page
And I go to "Members"
And I change "Pete" access level to master
And I visit project "Shop" settings page
And I go to "Audit Events"
Then I should see the audit event listed
......@@ -63,17 +63,6 @@ Feature: Project
And I visit project "Shop" page
Then I should see project "Shop" README
@javascript
Scenario: I should see audit events
And gitlab user "Pete"
And "Pete" is "Shop" developer
When I visit project "Shop" page
And I go to "Members"
And I change "Pete" access level to master
And I visit project "Shop" settings page
And I go to "Audit Events"
Then I should see the audit event listed
Scenario: I tag a project
When I visit edit project "Shop" page
Then I should see project settings
......
......@@ -24,4 +24,47 @@ class Spinach::Features::AuditEvent < Spinach::FeatureSteps
step 'I see deploy key event' do
expect(page).to have_content("Add deploy key")
end
step 'I should see the audit event listed' do
page.within('table#audits') do
expect(page).to have_content "Change access level from developer to master"
expect(page).to have_content(project.owner.name)
expect(page).to have_content('Pete')
end
end
step 'gitlab user "Pete"' do
create(:user, name: "Pete")
end
step '"Pete" is "Shop" developer' do
user = User.find_by(name: "Pete")
project = Project.find_by(name: "Shop")
project.team << [user, :developer]
end
step 'I go to "Members"' do
find(:link, 'Members').trigger('click')
end
step 'I visit project "Shop" settings page' do
find(:link, 'Settings').trigger('click')
end
step 'I change "Pete" access level to master' do
user = User.find_by(name: "Pete")
project_member = @project.project_members.find_by(user_id: user)
page.within "#project_member_#{project_member.id}" do
click_button "Edit access level"
select "Master", from: "project_member_access_level"
click_button "Save"
end
sleep 0.05
end
step 'I go to "Audit Events"' do
find(:link, 'Audit Events').trigger('click')
end
end
......@@ -112,16 +112,6 @@ class Spinach::Features::Project < Spinach::FeatureSteps
expect(page).to have_content 'testme'
end
step 'gitlab user "Pete"' do
create(:user, name: "Pete")
end
step '"Pete" is "Shop" developer' do
user = User.find_by(name: "Pete")
project = Project.find_by(name: "Shop")
project.team << [user, :developer]
end
step 'I visit project "Shop" settings page' do
click_link 'Settings'
end
......@@ -130,31 +120,6 @@ class Spinach::Features::Project < Spinach::FeatureSteps
click_link 'Members'
end
step 'I change "Pete" access level to master' do
user = User.find_by(name: "Pete")
project_member = @project.project_members.find_by(user_id: user)
page.within "#project_member_#{project_member.id}" do
click_button "Edit access level"
select "Master", from: "project_member_access_level"
click_button "Save"
end
sleep 0.05
end
step 'I go to "Audit Events"' do
find(:link, 'Audit Events').trigger('click')
end
step 'I should see the audit event listed' do
page.within('table#audits') do
expect(page).to have_content "Change access level from developer to master"
expect(page).to have_content(project.owner.name)
expect(page).to have_content('Pete')
end
end
step 'I add project tags' do
fill_in 'Tags', with: 'tag1, tag2'
end
......
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