The tier_list input field is probably a select. Your text input field probably has a different name?
How should I write this test
So I have two database tables with a many to many relationship. One of them is Item and the other one it Tier.
I have a form which takes the name of the new Item and the Tier id or if he enters a string it will create the new tier and save it to the database.
For example the user enters "Photo" as the item name, and enters "Gold" as a new tier which doesn't exsist. This is the same as "Many to Many Relations (With Tags) " in the laravel 5 fundementals series here on laracasts.
How to come about testing this? I know my code works because I tried it on the browser and works but i want to create tests for it, now I know that first you need to write the test first and then the code but bear with me please :)
The following is what I did
$item = TestDummy::create('App\Item');
$this->user_log_in();
$this->visit('items/create')
->type($item->name, 'name')
->type('Gold', 'tier_list')
->press('Create new Item')
->verifyInDatabase('items', $item);
When I run this test it gives me the following error Input "tier_list" cannot take "Gold" as a value (possible values: ).
Please or to participate in this conversation.