New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrading to Padrino 0.12 and running now the specs give me database access output - Padrino Setup thing? #1632

Closed
wikimatze opened this Issue Mar 24, 2014 · 1 comment

Comments

Projects
None yet
2 participants
@wikimatze
Member

wikimatze commented Mar 24, 2014

Hi guys, I had no problems with migrating an existing app to the lastest padrino 0.12 version.

Running the specs with rspec gives me the following output:

  SessionsHelper
    #current_user
      output the current user if current user is already set
    DEBUG -  User Load (1.1ms)  SELECT "users".* FROM "users" LIMIT 1
    DEBUG -  TEMPLATE (0.0010s) /page/home
    DEBUG -  TEMPLATE (0.0011s) /application
    DEBUG -  User Load (0.8ms)  SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1
    DEBUG -       GET (0.0339s) / - 200 OK
    DEBUG -  User Load (1.0ms)  SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1
      find the user by id from the current session
    #current_user?
      returns true if current user is logged in
      returns false if user is not logged in
    #sign_in
    DEBUG -  User Load (1.4ms)  SELECT "users".* FROM "users" LIMIT 1
    DEBUG -  TEMPLATE (0.0010s) /page/home
    DEBUG -  TEMPLATE (0.0010s) /application
    DEBUG -  User Load (0.9ms)  SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1
    DEBUG -       GET (0.0332s) / - 200 OK
      it sets the current user to the signed in user
    #signed_in?
      return false if user is not logged in
      return true if user is logged in

  JobOffer Model
    can be created

Has this something to do with the rspec debugging level?. Here is my spec_helper.rb

  PADRINO_ENV = 'test' unless defined?(PADRINO_ENV)
  require File.expand_path(File.dirname(__FILE__) + "/../config/boot")
  require File.dirname(__FILE__) + "/factories"
  Dir[File.dirname(__FILE__) + '/../app/helpers/**.rb'].each { |file| require file }

  RSpec.configure do |conf|
    conf.mock_with :rspec
    conf.include Rack::Test::Methods
    conf.include FactoryGirl::Syntax::Methods
    conf.full_backtrace= false # save the console
    conf.color_enabled= true   # save your eyes
    conf.formatter = :documentation

    ActiveRecord::Base.observers.disable :all # => Turn them all off
  end

  # Have access to the session variables.
  def session
    last_request.env['rack.session']
  end

  def app
    ##
    # You can handle all padrino applications using instead:
    #   Padrino.application
    JobVacancy::App.tap { |app|  }
  end

You can find the code of the application under https://github.com/matthias-guenther/job-vacancy/tree/user-update

@ujifgc ujifgc closed this in ba434f2 Mar 27, 2014

@ujifgc

This comment has been minimized.

Show comment
Hide comment
@ujifgc

ujifgc Mar 27, 2014

Member

Thank you for your report. Fixed in ba434f2

Member

ujifgc commented Mar 27, 2014

Thank you for your report. Fixed in ba434f2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment