debian-mirror-gitlab/features/steps/shared/user.rb

46 lines
996 B
Ruby
Raw Normal View History

2014-09-02 18:07:02 +05:30
module SharedUser
include Spinach::DSL
step 'User "John Doe" exists' do
2015-09-11 14:41:01 +05:30
user_exists("John Doe", { username: "john_doe" })
2014-09-02 18:07:02 +05:30
end
step 'User "Mary Jane" exists' do
2015-09-11 14:41:01 +05:30
user_exists("Mary Jane", { username: "mary_jane" })
2014-09-02 18:07:02 +05:30
end
2015-12-23 02:04:40 +05:30
step 'gitlab user "Mike"' do
create(:user, name: "Mike")
end
2014-09-02 18:07:02 +05:30
protected
def user_exists(name, options = {})
2015-09-11 14:41:01 +05:30
User.find_by(name: name) || create(:user, { name: name, admin: false }.merge(options))
2014-09-02 18:07:02 +05:30
end
2015-12-23 02:04:40 +05:30
step 'I have an ssh key' do
create(:personal_key, user: @user)
end
step 'I have no ssh keys' do
@user.keys.delete_all
end
2016-06-02 11:05:42 +05:30
step 'I click on "Personal projects" tab' do
page.within '.nav-links' do
click_link 'Personal projects'
end
expect(page).to have_css('.tab-content #projects.active')
end
step 'I click on "Contributed projects" tab' do
page.within '.nav-links' do
click_link 'Contributed projects'
end
expect(page).to have_css('.tab-content #contributed.active')
end
2014-09-02 18:07:02 +05:30
end