Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Thomas Walpole
    @twalpole
    not Rails
    Gus P
    @staycreativedesign
    ugh
    Thomas Walpole
    @twalpole
    Rails is building the url -- you need to configure it to use the hostname
    I'm trying to remember what the setting is url_options or default_url_options or something like that
    Gus P
    @staycreativedesign
    looking it up
      routes.default_url_options[:host] = 'lvh.me:6000'
    ?
    Thomas Walpole
    @twalpole
    you shouldn't need the port
    but something like that
    Gus P
    @staycreativedesign
    k
    Thomas Walpole
    @twalpole
    whatever setting affects the url helpers
    Gus P
    @staycreativedesign
    Rails.application.routes.default_url_options[:host] = 'lvh.me'
    Rails.application.default_url_options[:host] = 'lvh.me'
    rolf tried both
      config.action_controller.default_url_options = { host: 'lvh.me' }
    Thomas Walpole
    @twalpole
    Don't know -- it's possible rspec-rails (if you're using that) is overwriting it - but this is definitely not a Capybara issue
    Gus P
    @staycreativedesign
    tthis worked
    Thanks for pointing in right direction
    Gus P
    @staycreativedesign
    ugh
    now the session is notwhere to be found :(
    Thomas Walpole
    @twalpole
    You need to configure the cookie for however you want it to be used
    Gus P
    @staycreativedesign
    k
    the Organization is created and the login works but when I check for the count it gives me 0 what am I missing?
    Thomas Walpole
    @twalpole
    is login actually doing a login?
    or is it shortuctting the login process?
    Gus P
    @staycreativedesign
    actually doing a login
    Thomas Walpole
    @twalpole
    The other question would be whether the page where you're filling in data also has the text "Organizations" on it?
    Gus P
    @staycreativedesign
    lk
    ill brb but il check tha tout
    Thomas Walpole
    @twalpole
    Also - you don't have any check to synchronize behavior after submitting the signup form
    which means it's possible the login is actually occurring before the signup has been processed
    (if login is redirecting to a different page)
    Gus P
    @staycreativedesign
    yes login redirects to a diff page
    whats a check that I need?
    Thomas Walpole
    @twalpole
    Check that the signup has finished before doing the login
    Assert on whatever text shows up when signup succeeds
    Gus P
    @staycreativedesign
    k
    Gus P
    @staycreativedesign
    expect(page).to have_content('Organizations')
    that pagges
    that passes
    expect(page).to have_content('You have logged in')
    passes
    Gus P
    @staycreativedesign
    User Load (0.3ms)  SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2  [["id", 1], ["LIMIT", 1]]
      Rendering organizations/index.haml within layouts/dashboard
      Organization Load (0.6ms)  SELECT "organizations".* FROM "organizations"
      Client Load (0.4ms)  SELECT "clients".* FROM "clients" WHERE "clients"."organization_id" = $1  [["organization_id", 1]]
      Rendered organizations/index.haml within layouts/dashboard (Duration: 5.2ms | Allocations: 4059)
    thats the test log
    Gus P
    @staycreativedesign
    as you should, you're using database-cleaner in transactional mode. Each spec example is performed in a transaction that gets rolled back, never committed to the database. The two processes/threads (spec runner and request handler) are each using their own database connection and therefore can't see database changes made in an uncommitted transaction in a different database connection.
    Gus P
    @staycreativedesign
    Ok why does my feature test pass but my system test fails when i change it from type
    Thomas Walpole
    @twalpole
    because feature tests and system tests have different settings
    Gus P
    @staycreativedesign
    ok
    ugh
    Phuc Trinh
    @trinhcanhphuc

    I was testing with rails system test with internet explorer.
    I configed applications_system_test_case.rb to

    class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
      driven_by :selenium, using: :internet_explorer
    end

    In my test file. I wrote:

    assert_empty page.driver.browser.manage.logs.get(:browser)

    When I run rails test:system. Rails console return this error:

    NoMethodError: undefined method `log' for #<Selenium::WebDriver::Remote::W3C::Bridge:0x000000000f03c5f0>

    Can you help me to resolve this bug. Thanks