Skip to content

Instantly share code, notes, and snippets.

@shekibobo
shekibobo / InjectableActivityScenario.kt
Created July 27, 2019 01:50 — forked from rharter/InjectableActivityScenario.kt
An ActivityScenario that allows you to use Dagger Android's automatic, lifecycle based injection without making your Application class `open`, or overriding it in tests.
package com.pixite.pigment.testing
import android.app.Activity
import android.app.Instrumentation
import android.content.Context
import android.content.Intent
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.fragment.app.FragmentManager
import androidx.lifecycle.Lifecycle
@shekibobo
shekibobo / InjectableActivityScenario.kt
Created July 27, 2019 01:50 — forked from rharter/InjectableActivityScenario.kt
An ActivityScenario that allows you to use Dagger Android's automatic, lifecycle based injection without making your Application class `open`, or overriding it in tests.
package com.pixite.pigment.testing
import android.app.Activity
import android.app.Instrumentation
import android.content.Context
import android.content.Intent
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.fragment.app.FragmentManager
import androidx.lifecycle.Lifecycle
class User < ActiveRecord::Base
rolify :after_add => :event_added_mew_role #, :role_cname => 'Role'
accepts_nested_attributes_for :roles
attr_accessible :roles_attributes
# Include default devise modules. Others available are:
# :confirmable,
# :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable, :token_authenticatable,
:recoverable, :rememberable, :trackable, :validatable