diff options
author | Mykhailo Formus <mikeformus@gmail.com> | 2018-07-12 11:59:40 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-07-12 11:59:40 +0000 |
commit | 29955c9c474de957415da21ec3a330b596807f74 (patch) | |
tree | d21b6365897a1cb79fe549c20a86aacca35d3b7a /qa/qa/factory/resource/user.rb | |
parent | fc4c7956850ff40100301ea44aaf0b8b8725e114 (diff) | |
download | gitlab-ce-29955c9c474de957415da21ec3a330b596807f74.tar.gz |
Adding spec to test basic forking functionalities
Diffstat (limited to 'qa/qa/factory/resource/user.rb')
-rw-r--r-- | qa/qa/factory/resource/user.rb | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/qa/qa/factory/resource/user.rb b/qa/qa/factory/resource/user.rb new file mode 100644 index 00000000000..e08df9e0cd0 --- /dev/null +++ b/qa/qa/factory/resource/user.rb @@ -0,0 +1,34 @@ +require 'securerandom' + +module QA + module Factory + module Resource + class User < Factory::Base + attr_accessor :name, :username, :email, :password + + def initialize + @name = "name-#{SecureRandom.hex(8)}" + @username = "username-#{SecureRandom.hex(8)}" + @email = "mail#{SecureRandom.hex(8)}@mail.com" + @password = 'password' + end + + product(:name) { |factory| factory.name } + + product(:username) { |factory| factory.username } + + product(:email) { |factory| factory.email } + + product(:password) { |factory| factory.password } + + def fabricate! + Page::Menu::Main.act { sign_out } + Page::Main::Login.act { switch_to_register_tab } + Page::Main::SignUp.perform do |page| + page.sign_up!(name: name, username: username, email: email, password: password) + end + end + end + end + end +end |