Last active
August 29, 2015 14:06
-
-
Save noili/07aedc468907a4f6f7a7 to your computer and use it in GitHub Desktop.
steps_test.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class StepTest < ActiveSupport::TestCase | |
| test "create step with unexistant office" do | |
| step = Step.create name: 'Computo' | |
| assert step.office.name == 'Computo' | |
| end | |
| test "create step with existant office" do | |
| office = offices :computo | |
| step = Step.create office: office | |
| assert step.office.name == 'Computo' | |
| end | |
| end | |
| no sería asi el test del controller? | |
| require 'test_helper' | |
| class StepsControllerTest < ActionController::TestCase | |
| test "move file record through offices" do | |
| file_record = file_records(:legal) | |
| office = offices :computo | |
| step = {office_id: office.id} | |
| post :create, step: step, file_record_id: file_record.id | |
| assert file_record.steps.last.office.name == 'Computo' | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
si no te anda, probá con esta modificación
cuando a la relación le mandás true, vuelve a hacer la consulta. o sea, la actualiza.