diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-02-21 10:41:37 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-02-21 10:41:37 +0200 |
commit | 03f6a28ec0dab308070e83ec422f12fa289aad9f (patch) | |
tree | a2b72dd5944863f38f7c7397590626223ab0fc5a /spec/requests/admin/admin_users_spec.rb | |
parent | 9f722427e5835e4aeb5c1dd6a9cc8720b40d87c0 (diff) | |
download | gitlab-ce-03f6a28ec0dab308070e83ec422f12fa289aad9f.tar.gz |
move capybara scenarios to spec/features
Diffstat (limited to 'spec/requests/admin/admin_users_spec.rb')
-rw-r--r-- | spec/requests/admin/admin_users_spec.rb | 135 |
1 files changed, 0 insertions, 135 deletions
diff --git a/spec/requests/admin/admin_users_spec.rb b/spec/requests/admin/admin_users_spec.rb deleted file mode 100644 index 455caf4a376..00000000000 --- a/spec/requests/admin/admin_users_spec.rb +++ /dev/null @@ -1,135 +0,0 @@ -require 'spec_helper' - -describe "Admin::Users" do - before { login_as :admin } - - describe "GET /admin/users" do - before do - visit admin_users_path - end - - it "should be ok" do - current_path.should == admin_users_path - end - - it "should have users list" do - page.should have_content(@user.email) - page.should have_content(@user.name) - end - end - - describe "GET /admin/users/new" do - before do - @password = "123ABC" - visit new_admin_user_path - fill_in "user_name", with: "Big Bang" - fill_in "user_username", with: "bang" - fill_in "user_email", with: "bigbang@mail.com" - fill_in "user_password", with: @password - fill_in "user_password_confirmation", with: @password - end - - it "should create new user" do - expect { click_button "Save" }.to change {User.count}.by(1) - end - - it "should create user with valid data" do - click_button "Save" - user = User.last - user.name.should == "Big Bang" - user.email.should == "bigbang@mail.com" - end - - it "should call send mail" do - Notify.should_receive(:new_user_email) - - User.observers.enable :user_observer do - click_button "Save" - end - end - - it "should send valid email to user with email & password" do - Gitlab.config.gitlab.stub(:signup_enabled).and_return(false) - User.observers.enable :user_observer do - click_button "Save" - user = User.last - email = ActionMailer::Base.deliveries.last - email.subject.should have_content("Account was created") - email.body.should have_content(user.email) - email.body.should have_content(@password) - end - end - - it "should send valid email to user with email without password when signup is enabled" do - Gitlab.config.gitlab.stub(:signup_enabled).and_return(true) - User.observers.enable :user_observer do - click_button "Save" - user = User.last - email = ActionMailer::Base.deliveries.last - email.subject.should have_content("Account was created") - email.body.should have_content(user.email) - email.body.should_not have_content(@password) - end - end - end - - describe "GET /admin/users/:id" do - before do - visit admin_users_path - click_link "#{@user.name}" - end - - it "should have user info" do - page.should have_content(@user.email) - page.should have_content(@user.name) - page.should have_content(@user.projects_limit) - end - end - - describe "GET /admin/users/:id/edit" do - before do - @simple_user = create(:user) - visit admin_users_path - click_link "edit_user_#{@simple_user.id}" - end - - it "should have user edit page" do - page.should have_content("Name") - page.should have_content("Password") - end - - describe "Update user" do - before do - fill_in "user_name", with: "Big Bang" - fill_in "user_email", with: "bigbang@mail.com" - check "user_admin" - click_button "Save" - end - - it "should show page with new data" do - page.should have_content("bigbang@mail.com") - page.should have_content("Big Bang") - end - - it "should change user entry" do - @simple_user.reload - @simple_user.name.should == "Big Bang" - @simple_user.is_admin?.should be_true - end - end - end - - describe "Add new project" do - before do - @new_project = create(:project) - visit admin_user_path(@user) - end - - it "should create new user" do - select @new_project.name, from: "project_ids" - expect { click_button "Add" }.to change { UsersProject.count }.by(1) - page.should have_content @new_project.name - current_path.should == admin_user_path(@user) - end - end -end |