-
Notifications
You must be signed in to change notification settings - Fork 433
/
user_home_page.rb
47 lines (37 loc) · 1.47 KB
/
user_home_page.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
require "browser_helper"
RSpec.feature "User's home project creation", type: :feature, js: true do
let!(:user) {
create(:confirmed_user, {
login: "Jim",
realname: "Jim Knopf",
email: "jim.knopf@puppenkiste.com"
})
}
before do
login user
visit home_path
end
scenario "view home page" do
expect(page).to have_css("#home-realname", text: "Jim Knopf")
expect(page).to have_css("a[href='mailto:jim.knopf@puppenkiste.com']", text: "jim.knopf@puppenkiste.com")
expect(page).to have_text("Edit your account")
expect(page).to have_text("Change your password")
expect(page).to have_link("Involved Packages")
expect(page).to have_link("Involved Projects")
expect(page).to have_link("Owned Project/Packages")
expect(page).to have_link("Incoming Requests")
expect(page).to have_link("Outgoing Requests")
expect(page).to have_link("Declined Requests")
expect(page).to have_link("All Requests")
expect(page).not_to have_link("Maintenance Requests")
end
scenario "edit account information" do
click_link("Edit your account")
fill_in "user_realname", with: "John Doe"
fill_in "user_email", with: "john.doe@opensuse.org"
click_button("Ok")
expect(page).to have_text("User data for user 'Jim' successfully updated.")
expect(page).to have_css("#home-realname", text: "John Doe")
expect(page).to have_css("a[href='mailto:john.doe@opensuse.org']", text: "john.doe@opensuse.org")
end
end