Skip to content

Commit

Permalink
ignore new lines
Browse files Browse the repository at this point in the history
  • Loading branch information
cantino committed May 9, 2015
1 parent 5067104 commit e6903a8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/agents/java_script_agent.rb
Expand Up @@ -135,7 +135,7 @@ def code
end

def credential_referenced_by_code
interpolated['code'] =~ /\Acredential:(.*)\Z/ && $1.strip
interpolated['code'].strip =~ /\Acredential:(.*)\Z/ && $1
end

def setup_javascript
Expand Down
2 changes: 1 addition & 1 deletion spec/models/agents/java_script_agent_spec.rb
Expand Up @@ -92,7 +92,7 @@
describe "using credentials as code" do
before do
@agent.user.user_credentials.create :credential_name => 'code-foo', :credential_value => 'Agent.check = function() { this.log("ran it"); };'
@agent.options['code'] = 'credential:code-foo'
@agent.options['code'] = "credential:code-foo\n\n"
@agent.save!
end

Expand Down

0 comments on commit e6903a8

Please sign in to comment.