| logins_spec.rb - warvox - VoIP based wardialing tool, forked from rapid7/warvox. | |
| git clone git://jay.scot/warvox | |
| Log | |
| Files | |
| Refs | |
| README | |
| --- | |
| logins_spec.rb (1754B) | |
| --- | |
| 1 require 'rails_helper' | |
| 2 | |
| 3 RSpec.feature "Logins", type: :feature do | |
| 4 it "login with valid credentials" do | |
| 5 user = create(:user) | |
| 6 visit login_path | |
| 7 within "#new_user_session" do | |
| 8 expect(page).to have_content "Username" | |
| 9 expect(page).to have_content "Password" | |
| 10 fill_in "user_session_login", with: user.login | |
| 11 fill_in "user_session_password", with: 'RandomPass' | |
| 12 click_button "Sign in" | |
| 13 end | |
| 14 within "div.content" do | |
| 15 expect(page).to have_content "WarVOX Projects" | |
| 16 end | |
| 17 end | |
| 18 | |
| 19 it "failed login with invalid password valid username" do | |
| 20 user = create(:user) | |
| 21 visit login_path | |
| 22 within "#new_user_session" do | |
| 23 fill_in "user_session_login", with: user.login | |
| 24 fill_in "user_session_password", with: 'WrongPassword' | |
| 25 click_button "Sign in" | |
| 26 end | |
| 27 expect(page).to have_content "Password is not valid" | |
| 28 end | |
| 29 | |
| 30 it "failed login with invalid username valid password" do | |
| 31 user = create(:user) | |
| 32 visit login_path | |
| 33 within "#new_user_session" do | |
| 34 fill_in "user_session_login", with: user.login + "Wrong" | |
| 35 fill_in "user_session_password", with: 'RandomPass' | |
| 36 click_button "Sign in" | |
| 37 end | |
| 38 expect(page).to have_content "Login is not valid" | |
| 39 end | |
| 40 | |
| 41 it "failed login with no input entered" do | |
| 42 visit login_path | |
| 43 within "#new_user_session" do | |
| 44 click_button "Sign in" | |
| 45 end | |
| 46 expect(page).to have_content "You did not provide any details for au… | |
| 47 end | |
| 48 | |
| 49 it "failed login with no password entered" do | |
| 50 user = create(:user) | |
| 51 visit login_path | |
| 52 within "#new_user_session" do | |
| 53 fill_in "user_session_login", with: user.login | |
| 54 click_button "Sign in" | |
| 55 end | |
| 56 expect(page).to have_content "Password cannot be blank" | |
| 57 end | |
| 58 end |