summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/controllers/v1/smtp_certs_controller.rb2
-rw-r--r--test/functional/v1/smtp_certs_controller_test.rb1
-rw-r--r--test/support/api_integration_test.rb2
3 files changed, 3 insertions, 2 deletions
diff --git a/app/controllers/v1/smtp_certs_controller.rb b/app/controllers/v1/smtp_certs_controller.rb
index 258b391..533a19a 100644
--- a/app/controllers/v1/smtp_certs_controller.rb
+++ b/app/controllers/v1/smtp_certs_controller.rb
@@ -3,7 +3,7 @@ class V1::SmtpCertsController < ApplicationController
before_filter :require_login
before_filter :require_email_account
- # GET /cert
+ # GET /1/smtp_cert
def show
@cert = ClientCertificate.new prefix: current_user.email_address
current_user.identity.cert_fingerprints << @cert.fingerprint
diff --git a/test/functional/v1/smtp_certs_controller_test.rb b/test/functional/v1/smtp_certs_controller_test.rb
index f9ba26f..169f414 100644
--- a/test/functional/v1/smtp_certs_controller_test.rb
+++ b/test/functional/v1/smtp_certs_controller_test.rb
@@ -18,6 +18,7 @@ class V1::SmtpCertsControllerTest < ActionController::TestCase
test "send cert with username" do
login effective_service_level: ServiceLevel.new(id: 2)
cert = expect_cert(@current_user.email_address)
+ cert.expects(:fingerprint).returns('fingerprint')
get :show
assert_response :success
assert_equal cert.to_s, @response.body
diff --git a/test/support/api_integration_test.rb b/test/support/api_integration_test.rb
index aa9c00d..0e8e261 100644
--- a/test/support/api_integration_test.rb
+++ b/test/support/api_integration_test.rb
@@ -7,7 +7,7 @@ class ApiIntegrationTest < ActionDispatch::IntegrationTest
@user ||= user ||= FactoryGirl.create(:user)
@token ||= DUMMY_TOKEN
# make sure @token is up to date if it already exists
- @token.reload if @token.persisted
+ @token.reload if @token.persisted?
@token.user_id = @user.id
@token.last_seen_at = Time.now
@token.save