Newer
Older
describe "Admin::Users", feature: true do
visit admin_users_path
end
it "should be ok" do
current_path.should == admin_users_path
end
page.should have_content(@user.email)
page.should have_content(@user.name)
end
end
fill_in "user_name", with: "Big Bang"
Dmitriy Zaporozhets
committed
fill_in "user_username", with: "bang"
fill_in "user_email", with: "bigbang@mail.com"
expect { click_button "Create user" }.to change {User.count}.by(1)
it "should apply defaults to user" do
click_button "Create user"
user.projects_limit.should == Gitlab.config.gitlab.default_projects_limit
user.can_create_group.should == Gitlab.config.gitlab.default_can_create_group
end
user.name.should == "Big Bang"
user.email.should == "bigbang@mail.com"
end
it "should send valid email to user with email & password" do
email = ActionMailer::Base.deliveries.last
email.subject.should have_content("Account was created")
email.text_part.body.should have_content(user.email)
email.text_part.body.should have_content('password')
page.should have_content(@user.email)
page.should have_content(@user.name)
end
end
@simple_user = create(:user)
visit admin_users_path
click_link "edit_user_#{@simple_user.id}"
end
page.should have_content("Name")
page.should have_content("Password")
end
describe "Update user" do
fill_in "user_name", with: "Big Bang"
fill_in "user_email", with: "bigbang@mail.com"
page.should have_content("bigbang@mail.com")
page.should have_content("Big Bang")
end