require'spec_helper'describeCi::Build,models: truedolet(:build){create(:ci_build)}let(:test_trace){'This is a test'}describe'#trace'doit'obfuscates project runners token'doallow(build).toreceive(:raw_trace).and_return("Test: #{build.project.runners_token}")expect(build.trace).toeq("Test: xxxxxx")endit'empty project runners token'doallow(build).toreceive(:raw_trace).and_return(test_trace)# runners_token can't normally be set to nilallow(build.project).toreceive(:runners_token).and_return(nil)expect(build.trace).toeq(test_trace)endendend