✔️ TODO: See if configs can be simplified.

pull/679/head
Rick Carlino 2018-02-25 12:23:33 -06:00
parent 9a8272615e
commit 279cf24b84
3 changed files with 18 additions and 9 deletions

View File

@ -1,16 +1,22 @@
require "spec_helper"
describe "the signin process", type: :feature, js: true do
let!(:user) { FactoryBot.create(:user) }
password = "password123"
let!(:user) { FactoryBot.create(:user, password: password) }
login_form_selector = \
"div.col-sm-5:nth-child(1) > div:nth-child(1) >"\
" div:nth-child(2) > form:nth-child(1)"
it "signs me in" do
it "signs me in" do
visit "http://localhost:3000/"
binding.pry
within(".widget-body") do
fill_in "email", with: "user@example.com"
fill_in "password", with: "password"
password = "password123"
within(login_form_selector) do
fill_in "login_email", with: user.email
fill_in "login_password", with: user.password
fill_in "login_email", with: "" # Trigger blur event
click_button "Login"
end
expect(page).to have_content "Success"
sleep 3
expect(page).to have_content "MOTOR COORDINATES (MM)"
end
end

View File

@ -1,3 +1,4 @@
DO_INTEGRATION = !!ENV["RUN_CAPYBARA"]
ENV["MQTT_HOST"] = "blooper.io"
ENV["OS_UPDATE_SERVER"] = "http://non_legacy_update_url.com"
require "simplecov"
@ -33,7 +34,7 @@ DatabaseCleaner.strategy = :truncation
DatabaseCleaner.clean
RSpec.configure do |config|
if ENV["RUN_CAPYBARA"]
if DO_INTEGRATION
# Do I need to run `env RAILS_ENV=productiono npm run build`?
require "capybara/rails"
require "capybara/rspec"
@ -46,7 +47,7 @@ RSpec.configure do |config|
config.color = true
config.fail_fast = 10
config.backtrace_exclusion_patterns = [/gems/]
config.filter_run_excluding type: :feature unless DO_INTEGRATION
config.include Helpers
config.infer_spec_type_from_file_location!
config.order = "random"

View File

@ -86,6 +86,7 @@ export class Login extends React.Component<LoginProps, {}> {
<BlurableInput
type="email"
value={email || ""}
name="login_email"
onCommit={onEmailChange} />
<label>
{t("Password")}
@ -93,6 +94,7 @@ export class Login extends React.Component<LoginProps, {}> {
<BlurableInput
type="password"
value={loginPassword || ""}
name="login_password"
onCommit={onLoginPasswordChange} />
<a className="forgot-password" onClick={onToggleForgotPassword} >
{t("Forgot password?")}