Sha256: 1fb3820daff49c0334afba571e5ea8eb8893a3edb9e0258eb537adbb3268cd56

Contents?: true

Size: 813 Bytes

Versions: 11

Compression:

Stored size: 813 Bytes

Contents

module ActiveRecord
  class Base
    # this method returns the attributes to use on controller tests
    def test_attributes
      attributes.delete_if do |key, value|
        ["id", "created_at", "updated_at"].include? key
      end
    end
  end
end

def create_session(user = nil)
  # You'll probably need to do something like this:
  #
  # controller.sign_in(user || FactoryGirl.create(:user))
  #
  # Or if you are using devise:
  #
  # sign_in(user || FactoryGirl.create(:user))
  #
  # If you don't need a user logged in, just leave this method as it is now
end

def valid_session_hash(user = nil)
  # You'll probably need to do something like this:
  #
  # user ||= FactoryGirl.create(:user)
  # {user_id: user.id}
  #
  # If you don't need a user logged in, just leave this method as it is now
  {}
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
silmarails-0.3.4 lib/generators/silmarails/install/files/spec/support/silmarails.rb
silmarails-0.3.2 lib/generators/silmarails/install/files/spec/support/silmarails.rb
silmarails-0.3.1 lib/generators/silmarails/install/files/spec/support/silmarails.rb
silmarails-0.3.0 lib/generators/silmarails/install/files/spec/support/silmarails.rb
silmarails-0.2.2 lib/generators/silmarails/install/files/spec/support/silmarails.rb
silmarails-0.2.1 lib/generators/silmarails/install/files/spec/support/silmarails.rb
silmarails-0.2.0 lib/generators/silmarails/install/files/spec/support/silmarails.rb
silmarails-0.1.1 lib/generators/silmarails/install/files/spec/support/silmarails.rb
genesis_rails-0.1.1 lib/generators/genesis_rails/install/files/spec/support/genesis_rails.rb
genesis_rails-0.1.0 lib/generators/genesis_rails/install/files/spec/support/genesis_rails.rb
genesis_rails-0.0.8 lib/generators/genesis_rails/install/files/spec/support/genesis_rails.rb