Farshad's avatar

model name and test

I create a model and migration with composer the model name is Activity and all is good

but when I run my test got that error not find App\Activite class why it should looking for that class

this is my test method

public function it_records_activity_when_a_thread_is_created()
    {

        $this->signIn();

        $thread=create('App\Thread');

        $this->assertDatabaseHas('activities',[
           'type' =>'created_thread',
           'user_id' =>auth()->id(),
           'subject_id' =>$thread->id,
           'subject_type'  =>'App\Thread'
        ]);

        $activity=Activity::first();

        $this->assertEquals($activity->subject->id,$thread->id);
    }
0 likes
1 reply
bheath's avatar

Can you call the Activity model in your controllers or anywhere else?

Is it namespaced as App?

Please or to participate in this conversation.