@@ -30,32 +30,41 @@ defmodule Mix.Tasks.Coh.InstallTest do
3030 ~w( --emails --repo=TestCoherence.Repo --log-only --no-migrations --module=TestCoherence)
3131 |> Mix.Tasks.Coh.Install . run ( )
3232
33- assert_file ( "config/config.exs" , [
34- "config :coherence," ,
35- "user_schema: TestCoherence.Coherence.User," ,
36- "repo: TestCoherence.Repo," ,
37- "module: TestCoherence" ,
38- "router: TestCoherenceWeb.Router" ,
39- "web_module: TestCoherenceWeb" ,
40- "messages_backend: TestCoherenceWeb.Coherence.Messages," ,
41- "opts: [:authenticatable]"
42- ] )
33+ assert_file ( "config/config.exs" , fn file ->
34+ expected =
35+ [
36+ "config :coherence," ,
37+ "user_schema: TestCoherence.Coherence.User," ,
38+ "repo: TestCoherence.Repo," ,
39+ "module: TestCoherence" ,
40+ "router: TestCoherenceWeb.Router" ,
41+ "web_module: TestCoherenceWeb" ,
42+ "messages_backend: TestCoherenceWeb.Coherence.Messages," ,
43+ "opts: [:authenticatable]"
44+ ]
45+ |> Enum . join ( "" )
46+
47+ String . replace ( file , "\n " , "" ) =~ expected
48+ end )
4349
44- assert_file ( "config/config.exs" , [
45- "registration_permitted_attributes: [\n \" email\" ,\n \" name\" ,\n \" password\" ,\n \" current_password\" ,\n \" password_confirmation\" \n ],\n "
46- ] )
50+ assert_file ( "config/config.exs" , fn file ->
51+ String . replace ( file , "\n \s +" , "" ) =~
52+ ~s( registration_permitted_attributes: ["email","name","password","current_password","password_confirmation"])
53+ end )
4754
48- assert_file ( "config/config.exs" , [
49- " invitation_permitted_attributes: [\ " name\" , \ " email\" ], \n "
50- ] )
55+ assert_file ( "config/config.exs" , fn file ->
56+ String . replace ( file , " \n \s +" , "" ) =~ ~s ( invitation_permitted_attributes: ["name", "email"] )
57+ end )
5158
52- assert_file ( "config/config.exs" , [
53- "password_reset_permitted_attributes: [\n \" reset_password_token\" ,\n \" password\" ,\n \" password_confirmation\" \n ],\n "
54- ] )
59+ assert_file ( "config/config.exs" , fn file ->
60+ String . replace ( file , "\n \s +" , "" ) =~
61+ ~s( password_reset_permitted_attributes: ["reset_password_token","password","password_confirmation"])
62+ end )
5563
56- assert_file ( "config/config.exs" , [
57- "session_permitted_attributes: [\" remember\" , \" email\" , \" password\" ],"
58- ] )
64+ assert_file ( "config/config.exs" , fn file ->
65+ String . replace ( file , "\n \s +" , "" ) =~
66+ ~s( session_permitted_attributes: ["remember","email","password"])
67+ end )
5968 end )
6069 end
6170
0 commit comments