summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2012-10-11 11:45:16 +0200
committerAzul <azul@leap.se>2012-10-11 11:45:16 +0200
commitbde15d4ec416c1c6c99c7ea8bad9d8ed5aca128d (patch)
tree9e1a580fbbbc1e2533c1be20d9177a251353884f
parent9416bd9b8829f57fa54d50e8b3f53f614a1b29b5 (diff)
fixed cert tests - adding test data and not testing the inline cert download filename
-rw-r--r--certs/test/functional/certs_controller_test.rb1
-rw-r--r--certs/test/unit/cert_test.rb3
-rw-r--r--config/cert38
-rw-r--r--test/dummy/config/cert56
4 files changed, 77 insertions, 21 deletions
diff --git a/certs/test/functional/certs_controller_test.rb b/certs/test/functional/certs_controller_test.rb
index 04669f5..295515b 100644
--- a/certs/test/functional/certs_controller_test.rb
+++ b/certs/test/functional/certs_controller_test.rb
@@ -10,6 +10,5 @@ class CertsControllerTest < ActionController::TestCase
get :show
assert_response :success
assert_equal cert.zipped, @response.body
- assert_attachement_filename "cert_stub.zip"
end
end
diff --git a/certs/test/unit/cert_test.rb b/certs/test/unit/cert_test.rb
index 21ef169..9362da2 100644
--- a/certs/test/unit/cert_test.rb
+++ b/certs/test/unit/cert_test.rb
@@ -17,8 +17,9 @@ class CertTest < ActiveSupport::TestCase
end
test "cert.zipped returns the actual data" do
- @sample.save # This is required!
+ @sample.save # This is required !
assert lines = @sample.zipped.split("\n")
+ assert_equal 56, lines.count
assert_equal "-----BEGIN RSA PRIVATE KEY-----", lines.first.chomp
assert_equal "-----END CERTIFICATE-----", lines.last.chomp
end
diff --git a/config/cert b/config/cert
index d8271d6..27db0fd 100644
--- a/config/cert
+++ b/config/cert
@@ -1,31 +1,31 @@
-----BEGIN RSA PRIVATE KEY-----
MIIFfQIBAAKCATEArnxTeU82frha6g4AchpzAA92ry0PD/FZVK5UiMsbwHfAl/XJ
udVH0+51DSC5X4p9esftRQNCaJY/4zESe15Sna7aR+FyUoE+LcPpzMpCYH61TUzj
-YLQLzfay6cw1arndyryELgehWh2KiDl/SOHQ8c914DQC87f3tvmWI7F0zb9KWE9c
-XepnHyr2QJDzMiLuL6UC7ChJYgqYAKDfElQHfCaQCteOUK8hc+uTReTXpAtD3S3X
-rC3KeJR+jOynTkJ5tLb/VwS2rmhZOWktBhAJflgKLXSc6Cz2uJBeARNLvTBAj66q
-zfvMIlBOBRCWSQfvzNlhZvqX2YKdal8egC9CAuBhUcIfExunVQnU+xbRx7W9Gg3i
+YLQLzfay6cw1arn QC87f3tvmWI7F0zb9KWE9c
+XepnHyr2QJDzMiL This is an invalid eOUK8hc+uTReTXpAtD3S3X
+rC3KeJR+jOynTkJ key block for testing Sc6Cz2uJBeARNLvTBAj66q
+zfvMIlBOBRCWSQf please replace with a IfExunVQnU+xbRx7W9Gg3i
+NV307K4fgLJbY4b valid client key Y69SOuXgz7ECsoXy1bWQsi
+TETM5TX/6dADz0z FCc8I167mT25s2HNLnZ8AI
8zqMwDMRf9x7a4GBGmm7n+YSCLy3f8fejw2ZAQIDAQABAoIBMAt3bSQ8Nz3AT20x
-NV307K4fgLJbY4bYhVaCIa5fAU22hkgWOscFGUl3/WY69SOuXgz7ECsoXy1bWQsi
-TETM5TX/6dADz0z/uaktRkiTLtCDkyuSIXaB7oKpszFCc8I167mT25s2HNLnZ8AI
XfEusdn/mGSpq7Co3CprStlr+IaVixpe622FPCNOt0x1RMjR2yrzYkvzC9DZperp
mWLj7XF3X8FS3gd0Whhl4bS5yZuC8cd7Gq4bx8mGPIwqQzwOXb1mJXt5RPv+zU6X
J4cSX0GIUBNb1yVsUDouqo1q+saPgBSjhS4xr6sb38XALvzvgVvY/M7YGpSr0Vyv
ErAwxaGpdk+RppAjcxWBXLuMcIgtU+gSoEogdYzJkoJdwOfcyIllyqlaamcv4T84
gMWRFncCgZkAzUBt1t3GpuyGVPkD2evtQrBWwg09kx1PAyoNwLDOiarmzUr/euvC
-m+FZ324xLCYXYBDXCwa3B1YsX9d54JuzXzClr+t0xoz5lZzDLgwEEdK9bttGBL0w
4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tmKenuWHTcz47Pm5WNhZP/l
WWxi9MBzz/80IediLG6qrlU=
@@ -33,24 +33,24 @@ WWxi9MBzz/80IediLG6qrlU=
-----BEGIN CERTIFICATE-----
MIIEAzCCAlWgAwIBAgIEUFDq+zANBgkqhkiG9w0BAQsFADAPMQ0wCwYDVQQDEwRU
RVNUMB4XDTEyMDkxMjIwMDUxNVoXDTEzMDkxMjIwMDUxNVowOjEPMA0GA1UEChMG
-eHgub3JnMScwJQYDVQQDEx5xdXVnaGVjYWUxYmFpNW9oU2hhaDdwaGlkYWVxdXUw
-ggFSMA0GCSqGSIb3DQEBAQUAA4IBPwAwggE6AoIBMQCufFN5TzZ+uFrqDgByGnMA
-D3avLQ8P8VlUrlSIyxvAd8CX9cm51UfT7nUNILlfin16x+1FA0Jolj/jMRJ7XlKd
-rtpH4XJSgT4tw+nMykJgfrVNTONgtAvN9rLpzDVqud3KvIQuB6FaHYqIOX9I4dDx
-z3XgNALzt/e2+ZYjsXTNv0pYT1xd6mcfKvZAkPMyIu4vpQLsKEliCpgAoN8SVAd8
-JpAK145QryFz65NF5NekC0PdLdesLcp4lH6M7KdOQnm0tv9XBLauaFk5aS0GEAl+
-WAotdJzoLPa4kF4BE0u9MECPrqrN+8wiUE4FEJZJB+/M2WFm+pfZgp1qXx6AL0IC
+YLQLzfay6cw1arn QC87f3tvmWI7F0zb9KWE9c
+XepnHyr2QJDzMiL This is an invalid eOUK8hc+uTReTXpAtD3S3X
+rC3KeJR+jOynTkJ cert block for testing Sc6Cz2uJBeARNLvTBAj66q
+zfvMIlBOBRCWSQf please replace with a IfExunVQnU+xbRx7W9Gg3i
+NV307K4fgLJbY4b valid server cert Y69SOuXgz7ECsoXy1bWQsi
+TETM5TX/6dADz0z FCc8I167mT25s2HNLnZ8AI
4GFRwh8TG6dVCdT7FtHHtb0aDeLzOozAMxF/3HtrgYEaabuf5hIIvLd/x96PDZkB
+WAotdJzoLPa4kF4BE0u9MECPrqrN+8wiUE4FEJZJB+/M2WFm+pfZgp1qXx6AL0IC
AgMBAAGjdjB0MAwGA1UdEwEB/wQCMAAwEwYDVR0lBAwwCgYIKwYBBQUHAwIwDwYD
VR0PAQH/BAUDAwegADAdBgNVHQ4EFgQUU9Uc5ljBzINN4S6oj80rn+mJTLEwHwYD
-VR0jBBgwFoAU/z1/F2dGNow5Kac+jx7NtyIM0BAwDQYJKoZIhvcNAQELBQADggGX
AMCxt8hxLtQlSgfY4MHxlNOE/hepArRQ1KoqW8TZ3DaDZacYuHK6TkarBuVshrAa
+VR0jBBgwFoAU/z1/F2dGNow5Kac+jx7NtyIM0BAwDQYJKoZIhvcNAQELBQADggGX
TkPLvTbMIeZ/DGC6snrnyspVPVun8X1NcdkqOiSWCt5Y1Li4sClXT+XUFaKES4NS
SN8LDKX0J+q2n4nRuotaOdq12qs8ZQkMsSI5ueR0soHY1XuSJCK75PFxLJKq3ydm
-c/YgEkmZwOBR7ypXnT0Tcele120v+qhCRSeoZIEwtm27Dp8+My82fpx7xMKYAHn8
FhMVy/bQZgl9QAt7HNK7QoISBmkQFYey0Qq7aotloMhlIyCSN569RcKHdPhZCsCE
-M6lQJXeXaD8sR9wE2nhxKnTJToebjr9mnlgavSsotnzjnm9fMt5CPGOUtG/qGNfB
+c/YgEkmZwOBR7ypXnT0Tcele120v+qhCRSeoZIEwtm27Dp8+My82fpx7xMKYAHn8
VhdODq6KZ9Tk8MnYenC7SfiJ/cR0N/Yw5R8Yaa1K5qO+dyIwfXTkTr/Kg97N72jE
+M6lQJXeXaD8sR9wE2nhxKnTJToebjr9mnlgavSsotnzjnm9fMt5CPGOUtG/qGNfB
GB/GF1HkbZW7VnGWjgNAozftTRCsFoCTwv/ICcW+vYEDVh+hzWjJ/KLl7PruKDPS
rBlWWdV02QtVKpKYKvynML9kyEX6HeM=
-----END CERTIFICATE-----
diff --git a/test/dummy/config/cert b/test/dummy/config/cert
index e69de29..27db0fd 100644
--- a/test/dummy/config/cert
+++ b/test/dummy/config/cert
@@ -0,0 +1,56 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIFfQIBAAKCATEArnxTeU82frha6g4AchpzAA92ry0PD/FZVK5UiMsbwHfAl/XJ
+udVH0+51DSC5X4p9esftRQNCaJY/4zESe15Sna7aR+FyUoE+LcPpzMpCYH61TUzj
+YLQLzfay6cw1arn QC87f3tvmWI7F0zb9KWE9c
+XepnHyr2QJDzMiL This is an invalid eOUK8hc+uTReTXpAtD3S3X
+rC3KeJR+jOynTkJ key block for testing Sc6Cz2uJBeARNLvTBAj66q
+zfvMIlBOBRCWSQf please replace with a IfExunVQnU+xbRx7W9Gg3i
+NV307K4fgLJbY4b valid client key Y69SOuXgz7ECsoXy1bWQsi
+TETM5TX/6dADz0z FCc8I167mT25s2HNLnZ8AI
+8zqMwDMRf9x7a4GBGmm7n+YSCLy3f8fejw2ZAQIDAQABAoIBMAt3bSQ8Nz3AT20x
+XfEusdn/mGSpq7Co3CprStlr+IaVixpe622FPCNOt0x1RMjR2yrzYkvzC9DZperp
+mWLj7XF3X8FS3gd0Whhl4bS5yZuC8cd7Gq4bx8mGPIwqQzwOXb1mJXt5RPv+zU6X
+J4cSX0GIUBNb1yVsUDouqo1q+saPgBSjhS4xr6sb38XALvzvgVvY/M7YGpSr0Vyv
+ErAwxaGpdk+RppAjcxWBXLuMcIgtU+gSoEogdYzJkoJdwOfcyIllyqlaamcv4T84
+gMWRFncCgZkAzUBt1t3GpuyGVPkD2evtQrBWwg09kx1PAyoNwLDOiarmzUr/euvC
+4W+BfbvmH3Q1dfyQMc/+Y2/LAhvwwkp1F66KsF1xcz6q3FCDN0BGurhIH3rsS1r8
+m+FZ324xLCYXYBDXCwa3B1YsX9d54JuzXzClr+t0xoz5lZzDLgwEEdK9bttGBL0w
+ReIl7KW/TwKDbkPxe+3yCI8CgZkA2aCJUmCtkvaCIX0Udr6g3iyu6lQYbq532/FW
+MNh+KJA3NqXOvGZd9T1DfjlxOqsfGD4H92ekUdy/GdX9SAH4A0RW24gUazNY9N1d
+tdkq8OAxwswquvXC0U5WXsZVp6z1CFawjUiZbW8CgZkAvP9V5SOkN7LWY0pFJJad
+i+oKiXdduqijR/uiXEuyc4v+KQ2lQM/1DEqu0hGKj+enYJtBGPMe+E9+XuZwYMWe
+nsmR1/LNPcM0U3LdOvpviOXv7zNUPyri5sMhjuDFnzMHw1REhsnKqk+XtKJ7yLx9
+I8hiBtKUlBUhietNWEQEnQzxxKMRELaAU+1RFJ7vEVb0JUXFCGPrmbsCgZkAyZrW
+4Zr+GyGz96AetksM5svDVqVed9qzxqPX7/i16F3HmIJKS8lVXLj3TDBJAQTJNhSN
+m+HD6mlClBNzaa2fCTMLtzjAiYhGsRIZbpagCKPRAmcH5bBPSmi+pahBJMBxxdtx
+NdhleRCuWBjM0nBAeYZNkIG3qLegqPaJif4zeJ74QWWsDePox8Xr59C6ev23nUUb
+MnMW7zECgZkAwOOGuqJHyUlsVuErs5c/rLyY0NAqrGoiBp3o5fGnuINzrZSO3zvY
+PcuBeQmnZbkNarfQxFz1ezcf6jmszNStktDj3tFSR8srqpcRKyUPDi1eHD81n8vv
+h1jew1zPRQaQvVZ88p0xacYJeRckbKxcIPGweVqpT9ZJAEGg4J6FFcH+fOIra/7R
+TgLJs443xbTO2GM/25Anc/Pj4bnL2GWqDTurTxANAtmKenuWHTcz47Pm5WNhZP/l
+WWxi9MBzz/80IediLG6qrlU=
+-----END RSA PRIVATE KEY-----
+-----BEGIN CERTIFICATE-----
+MIIEAzCCAlWgAwIBAgIEUFDq+zANBgkqhkiG9w0BAQsFADAPMQ0wCwYDVQQDEwRU
+RVNUMB4XDTEyMDkxMjIwMDUxNVoXDTEzMDkxMjIwMDUxNVowOjEPMA0GA1UEChMG
+YLQLzfay6cw1arn QC87f3tvmWI7F0zb9KWE9c
+XepnHyr2QJDzMiL This is an invalid eOUK8hc+uTReTXpAtD3S3X
+rC3KeJR+jOynTkJ cert block for testing Sc6Cz2uJBeARNLvTBAj66q
+zfvMIlBOBRCWSQf please replace with a IfExunVQnU+xbRx7W9Gg3i
+NV307K4fgLJbY4b valid server cert Y69SOuXgz7ECsoXy1bWQsi
+TETM5TX/6dADz0z FCc8I167mT25s2HNLnZ8AI
+4GFRwh8TG6dVCdT7FtHHtb0aDeLzOozAMxF/3HtrgYEaabuf5hIIvLd/x96PDZkB
+WAotdJzoLPa4kF4BE0u9MECPrqrN+8wiUE4FEJZJB+/M2WFm+pfZgp1qXx6AL0IC
+AgMBAAGjdjB0MAwGA1UdEwEB/wQCMAAwEwYDVR0lBAwwCgYIKwYBBQUHAwIwDwYD
+VR0PAQH/BAUDAwegADAdBgNVHQ4EFgQUU9Uc5ljBzINN4S6oj80rn+mJTLEwHwYD
+AMCxt8hxLtQlSgfY4MHxlNOE/hepArRQ1KoqW8TZ3DaDZacYuHK6TkarBuVshrAa
+VR0jBBgwFoAU/z1/F2dGNow5Kac+jx7NtyIM0BAwDQYJKoZIhvcNAQELBQADggGX
+TkPLvTbMIeZ/DGC6snrnyspVPVun8X1NcdkqOiSWCt5Y1Li4sClXT+XUFaKES4NS
+SN8LDKX0J+q2n4nRuotaOdq12qs8ZQkMsSI5ueR0soHY1XuSJCK75PFxLJKq3ydm
+FhMVy/bQZgl9QAt7HNK7QoISBmkQFYey0Qq7aotloMhlIyCSN569RcKHdPhZCsCE
+c/YgEkmZwOBR7ypXnT0Tcele120v+qhCRSeoZIEwtm27Dp8+My82fpx7xMKYAHn8
+VhdODq6KZ9Tk8MnYenC7SfiJ/cR0N/Yw5R8Yaa1K5qO+dyIwfXTkTr/Kg97N72jE
+M6lQJXeXaD8sR9wE2nhxKnTJToebjr9mnlgavSsotnzjnm9fMt5CPGOUtG/qGNfB
+GB/GF1HkbZW7VnGWjgNAozftTRCsFoCTwv/ICcW+vYEDVh+hzWjJ/KLl7PruKDPS
+rBlWWdV02QtVKpKYKvynML9kyEX6HeM=
+-----END CERTIFICATE-----