jeudi 31 décembre 2015

SyntaxError expecting end-of-input

Hi i am keep getting this message and i do not see anything wrong , can anybody help me? this is my code

ERROR["test_account_activation", UserMailerTest, 0.5950376749970019]
 test_account_activation#UserMailerTest (0.60s)
SyntaxError:         SyntaxError: /home/ubuntu/workspace/sample_app/app/mailers/user_mailer.rb:23: syntax error, unexpected keyword_end, expecting end-of-input
            test/mailers/user_mailer_test.rb:6:in `block in <class:UserMailerTest>'

ERROR["test_password_reset", UserMailerTest, 0.6068314979784191]
 test_password_reset#UserMailerTest (0.61s)
SyntaxError:         SyntaxError: /home/ubuntu/workspace/sample_app/app/mailers/user_mailer.rb:23: syntax error, unexpected keyword_end, expecting end-of-input
            test/mailers/user_mailer_test.rb:17:in `block in <class:UserMailerTest>'

user_mailer_test.rb

require 'test_helper'
class UserMailerTest < ActionMailer::TestCase
  test "account_activation" do
    user = users(:michael)
    user.activation_token = User.new_token
    mail = UserMailer.account_activation(user)
    assert_equal "Account activation", mail.subject
    assert_equal [user.email], mail.to
    assert_equal ["noreply@example.com"], mail.from
    assert_match user.name,               mail.body.encoded
    assert_match user.activation_token,   mail.body.encoded
    assert_match CGI::escape(user.email), mail.body.encoded
  end
  test "password_reset" do
    user = users(:michael)
    user.reset_token = User.new_token
    mail = UserMailer.password_reset(user)
    assert_equal "Password reset", mail.subject
    assert_equal [user.email], mail.to
    assert_equal ["noreply@example.com"], mail.from
    assert_match user.reset_token,        mail.body.encoded
    assert_match CGI::escape(user.email), mail.body.encoded
  end
end

I do not see the problem if think everything is ok!Thanks :)

Aucun commentaire:

Enregistrer un commentaire