2017-12-25 5 views
-2

Momentan auf Kanal 14 von Hartl's Rails Tutorial: Relationship validations. Nach dem Ausführen der Schienen Test bekomme ich 60 Fehler identisch mit dem unten, aber keine fehlgeschlagenen TestsWas verursacht meine 60 Fehler im Schienen-Test? hartl's rails tutorial ch 14.1.3 Beziehungsvalidierungen

Alle Tests haben den gleichen Fehler, dies ist nur ein Beispiel für einen Fehler. Sie bitte die passwordsResetTest Scheitern Referenz und konzentrieren sich auf die actualy Grund für den Fehler becasue dies ignorieren, was sie gemeinsam haben:

ERROR["test_expired_token", PasswordResetsTest, 5.314963563112542] 
test_expired_token#PasswordResetsTest (5.31s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:31.251242', '2017-12-25 17:00:31.251242', 298486374) 

    60/60: [=====================================================] 100% Time: 00:00:05, Time: 00:00:05 

Finished in 5.31679s 
60 tests, 0 assertions, 0 failures, 60 errors, 0 skips 

neu zu formulieren das folgende ist, was alle 60 der nicht bestandenen Tests gemeinsam haben, und es ist nicht ähnliche Artikel bei Ausfall PasswordResetsTest oder anderen spezifischen Test wie in den Kommentaren vorgeschlagen:

ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:31.251242', '2017-12-25 17:00:31.251242', 298486374) 

ich habe vor kurzem hinzugefügt Code versucht, Kommentar und auch versucht, „Schienen db: Reset“. Was ist der Grund für den Fehler? Bitte geben Sie an, ob ich weitere Dateien in diesem Post veröffentlichen soll. Bitte lesen Sie die Frage sorgfältig, bevor Sie sie als Duplikat oder Downrating markieren. Ich habe hier schon gesucht und nichts ähnliches gefunden. Wenn Klärung erforderlich ist, dann bitte fragen Sie und ich kann Dateien hinzufügen, wie nötig. da ich jetzt nicht weiß, wo der Fehler liegt und daher unsicher bin, welche Dateien zu posten sind.

EDIT: Die vollständige Liste des Testfehlers

ERROR["test_full_title_helper", ApplicationHelperTest, 0.5886939621996135] 
test_full_title_helper#ApplicationHelperTest (0.59s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:26.524378', '2017-12-25 17:00:26.524378', 298486374) 


ERROR["test_should_redirect_index_when_not_logged_in", UsersControllerTest, 0.6581872610840946] 
test_should_redirect_index_when_not_logged_in#UsersControllerTest (0.66s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:26.595209', '2017-12-25 17:00:26.595209', 298486374) 


ERROR["test_should_redirect_edit_when_logged_in_as_wrong_user", UsersControllerTest, 0.7289390380028635] 
test_should_redirect_edit_when_logged_in_as_wrong_user#UsersControllerTest (0.73s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:26.666070', '2017-12-25 17:00:26.666070', 298486374) 


ERROR["test_should_redirect_destroy_when_logged_in_as_a_non-admin", UsersControllerTest, 0.8095540381036699] 
test_should_redirect_destroy_when_logged_in_as_a_non-admin#UsersControllerTest (0.81s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:26.745831', '2017-12-25 17:00:26.745831', 298486374) 


ERROR["test_should_redirect_update_when_logged_in_as_wrong_user", UsersControllerTest, 0.8919061671476811] 
test_should_redirect_update_when_logged_in_as_wrong_user#UsersControllerTest (0.89s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:26.829000', '2017-12-25 17:00:26.829000', 298486374) 


ERROR["test_should_get_new", UsersControllerTest, 0.9679255231749266] 
test_should_get_new#UsersControllerTest (0.97s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: NIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:26.904892', '2017-12-25 17:00:26.904892', 298486374) 


ERROR["test_should_redirect_edit_when_not_logged_in", UsersControllerTest, 1.036473578074947] 
test_should_redirect_edit_when_not_logged_in#UsersControllerTest (1.04s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:26.973600', '2017-12-25 17:00:26.973600', 298486374) 


ERROR["test_should_redirect_update_when_not_logged_in", UsersControllerTest, 1.105857715010643] 
test_should_redirect_update_when_not_logged_in#UsersControllerTest (1.11s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:27.042843', '2017-12-25 17:00:27.042843', 298486374) 


ERROR["test_should_not_allow_the_admin_attribute_to_be_edited_via_the_web", UsersControllerTest, 1.174707662081346] 
test_should_not_allow_the_admin_attribute_to_be_edited_via_the_web#UsersControllerTest (1.17s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:27.112124', '2017-12-25 17:00:27.112124', 298486374) 


ERROR["test_should_redirect_destroy_when_not_logged_in", UsersControllerTest, 1.2486104799900204] 
test_should_redirect_destroy_when_not_logged_in#UsersControllerTest (1.25s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:27.185470', '2017-12-25 17:00:27.185470', 298486374) 


ERROR["test_invalid_signup_information", UsersSignupTest, 1.3177319581154734] 
test_invalid_signup_information#UsersSignupTest (1.32s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:27.254613', '2017-12-25 17:00:27.254613', 298486374) 


ERROR["test_valid_signup_information_with_account_activation", UsersSignupTest, 1.3930742440279573] 
test_valid_signup_information_with_account_activation#UsersSignupTest (1.39s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:27.329385', '2017-12-25 17:00:27.329385', 298486374) 


ERROR["test_layout_links_for_logged-in_and_non-logged-in_users", SiteLayoutTest, 1.470166060142219] 
test_layout_links_for_logged-in_and_non-logged-in_users#SiteLayoutTest (1.47s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:27.406652', '2017-12-25 17:00:27.406652', 298486374) 


ERROR["test_current_user_returns_nil_when_remember_digest_is_wrong", SessionsHelperTest, 1.5483627070207149] 
test_current_user_returns_nil_when_remember_digest_is_wrong#SessionsHelperTest (1.55s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:27.485238', '2017-12-25 17:00:27.485238', 298486374) 


ERROR["test_current_user_returns_right_user_when_session_is_nil", SessionsHelperTest, 1.622652635211125] 
test_current_user_returns_right_user_when_session_is_nil#SessionsHelperTest (1.62s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:27.559833', '2017-12-25 17:00:27.559833', 298486374) 


ERROR["test_login_with_invalid_information", UsersLoginTest, 1.691250520059839] 
test_login_with_invalid_information#UsersLoginTest (1.69s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:27.628577', '2017-12-25 17:00:27.628577', 298486374) 


ERROR["test_login_with_valid_information_followed_by_logout", UsersLoginTest, 1.7603829870931804] 
test_login_with_valid_information_followed_by_logout#UsersLoginTest (1.76s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:27.697564', '2017-12-25 17:00:27.697564', 298486374) 


ERROR["test_login_without_remembering", UsersLoginTest, 1.8318063172046095] 
test_login_without_remembering#UsersLoginTest (1.83s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:27.768689', '2017-12-25 17:00:27.768689', 298486374) 


ERROR["test_login_with_remembering", UsersLoginTest, 1.9019856851082295] 
test_login_with_remembering#UsersLoginTest (1.90s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:27.839130', '2017-12-25 17:00:27.839130', 298486374) 


ERROR["test_login_with_valid_information", UsersLoginTest, 1.9735339260660112] 
test_login_with_valid_information#UsersLoginTest (1.97s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:27.910388', '2017-12-25 17:00:27.910388', 298486374) 


ERROR["test_should_require_a_followed_id", RelationshipTest, 2.045193174155429] 
test_should_require_a_followed_id#RelationshipTest (2.05s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:27.982175', '2017-12-25 17:00:27.982175', 298486374) 


ERROR["test_should_be_valid", RelationshipTest, 2.116873636143282] 
test_should_be_valid#RelationshipTest (2.12s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:28.053873', '2017-12-25 17:00:28.053873', 298486374) 


ERROR["test_should_require_a_follower_id", RelationshipTest, 2.1939838810358196] 
test_should_require_a_follower_id#RelationshipTest (2.19s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:28.130608', '2017-12-25 17:00:28.130608', 298486374) 


ERROR["test_should_get_new", SessionsControllerTest, 2.2846957040019333] 
test_should_get_new#SessionsControllerTest (2.28s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:28.221151', '2017-12-25 17:00:28.221151', 298486374) 


ERROR["test_should_redirect_destroy_when_not_logged_in", MicropostsControllerTest, 2.362602182198316] 
test_should_redirect_destroy_when_not_logged_in#MicropostsControllerTest (2.36s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:28.299658', '2017-12-25 17:00:28.299658', 298486374) 


ERROR["test_should_redirect_create_when_not_logged_in", MicropostsControllerTest, 2.438112756004557] 
test_should_redirect_create_when_not_logged_in#MicropostsControllerTest (2.44s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:28.375220', '2017-12-25 17:00:28.375220', 298486374) 


ERROR["test_should_redirect_destroy_for_wrong_micropost", MicropostsControllerTest, 2.5149845741689205] 
test_should_redirect_destroy_for_wrong_micropost#MicropostsControllerTest (2.52s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:28.451724', '2017-12-25 17:00:28.451724', 298486374) 


ERROR["test_password_reset", UserMailerTest, 2.7664255590643734] 
test_password_reset#UserMailerTest (2.77s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:28.526384', '2017-12-25 17:00:28.526384', 298486374) 


ERROR["test_account_activation", UserMailerTest, 2.844500640174374] 
test_account_activation#UserMailerTest (2.84s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:28.780883', '2017-12-25 17:00:28.780883', 298486374) 


ERROR["test_content_should_be_at_most_140_characters", MicropostTest, 2.936807722086087] 
test_content_should_be_at_most_140_characters#MicropostTest (2.94s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:28.864369', '2017-12-25 17:00:28.864369', 298486374) 


ERROR["test_order_should_be_most_recent_first", MicropostTest, 3.025183034129441] 
test_order_should_be_most_recent_first#MicropostTest (3.03s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:28.961915', '2017-12-25 17:00:28.961915', 298486374) 


ERROR["test_should_be_valid", MicropostTest, 3.10498650604859] 
test_should_be_valid#MicropostTest (3.11s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:29.041512', '2017-12-25 17:00:29.041512', 298486374) 


ERROR["test_user_id_should_be_present", MicropostTest, 3.184497941052541] 
test_user_id_should_be_present#MicropostTest (3.18s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:29.121625', '2017-12-25 17:00:29.121625', 298486374) 


ERROR["test_content_should_be_present", MicropostTest, 3.257624409161508] 
test_content_should_be_present#MicropostTest (3.26s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:29.194734', '2017-12-25 17:00:29.194734', 298486374) 


ERROR["test_authenticated?_should_return_false_for_a_user_with_nil_digest", UserTest, 3.3349223020486534] 
test_authenticated?_should_return_false_for_a_user_with_nil_digest#UserTest (3.34s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:29.271242', '2017-12-25 17:00:29.271242', 298486374) 


ERROR["test_email_validation_should_accept_valid_addresses", UserTest, 3.418220450170338] 
test_email_validation_should_accept_valid_addresses#UserTest (3.42s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:29.354686', '2017-12-25 17:00:29.354686', 298486374) 


ERROR["test_associated_microposts_should_be_destroyed", UserTest, 3.497843796154484] 
test_associated_microposts_should_be_destroyed#UserTest (3.50s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:29.434424', '2017-12-25 17:00:29.434424', 298486374) 


ERROR["test_password_should_be_present_(nonblank)", UserTest, 3.5781150311231613] 
test_password_should_be_present_(nonblank)#UserTest (3.58s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:29.514940', '2017-12-25 17:00:29.514940', 298486374) 


ERROR["test_password_should_have_a_minimum_length", UserTest, 3.659053710056469] 
test_password_should_have_a_minimum_length#UserTest (3.66s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:29.595535', '2017-12-25 17:00:29.595535', 298486374) 


ERROR["test_name_should_be_present", UserTest, 3.7399447390343994] 
test_name_should_be_present#UserTest (3.74s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:29.676613', '2017-12-25 17:00:29.676613', 298486374) 


ERROR["test_email_should_be_present", UserTest, 3.81978895701468] 
test_email_should_be_present#UserTest (3.82s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:29.756511', '2017-12-25 17:00:29.756511', 298486374) 


ERROR["test_email_addresses_should_be_unique", UserTest, 3.895480133127421] 
test_email_addresses_should_be_unique#UserTest (3.90s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:29.832542', '2017-12-25 17:00:29.832542', 298486374) 


ERROR["test_email_should_not_be_too_long", UserTest, 3.9748866921290755] 
test_email_should_not_be_too_long#UserTest (3.97s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:29.911204', '2017-12-25 17:00:29.911204', 298486374) 


ERROR["test_email_addresses_should_be_saved_as_lower-case", UserTest, 4.048870469210669] 
test_email_addresses_should_be_saved_as_lower-case#UserTest (4.05s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:29.985941', '2017-12-25 17:00:29.985941', 298486374) 


ERROR["test_email_validation_should_reject_invalid_addresses", UserTest, 4.131249525118619] 
test_email_validation_should_reject_invalid_addresses#UserTest (4.13s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:30.067880', '2017-12-25 17:00:30.067880', 298486374) 


ERROR["test_name_should_not_be_too_long", UserTest, 4.211557199014351] 
test_name_should_not_be_too_long#UserTest (4.21s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:30.147790', '2017-12-25 17:00:30.147790', 298486374) 


ERROR["test_should_be_valid", UserTest, 4.291004430036992] 
test_should_be_valid#UserTest (4.29s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:30.228139', '2017-12-25 17:00:30.228139', 298486374) 


ERROR["test_micropost_interface", MicropostsInterfaceTest, 4.370504083111882] 
test_micropost_interface#MicropostsInterfaceTest (4.37s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:30.307553', '2017-12-25 17:00:30.307553', 298486374) 


ERROR["test_micropost_sidebar_count", MicropostsInterfaceTest, 4.4493381541687995] 
test_micropost_sidebar_count#MicropostsInterfaceTest (4.45s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:30.386600', '2017-12-25 17:00:30.386600', 298486374) 


ERROR["test_profile_display", UsersProfileTest, 4.524825826054439] 
test_profile_display#UsersProfileTest (4.52s) 
ActiveRecord::RecordNotUnique:   ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: relationships.follower_id, relationships.followed_id: INSERT INTO "relationships" ("follower_id", "followed_id", "created_at", "updated_at", "id") VALUES (1, 1, '2017-12-25 17:00:30.461488', '2017-12-25 17:00:30.461488', 298486374) 
+1

Mögliches Duplikat von [Passwort zurücksetzen Test fehlgeschlagen in M.Hartl Ruby on Rails Tutorial (3. Ausgabe), Kapitel 10 (10.54)] (https://stackoverflow.com/questions/31799519/password-reset-test-failing-in-mhartls-ruby-on-rails-tutorial-3rd-edition-c) –

+0

Es ist kein Duplikat. Ich gebe nur diese Testfehlermeldung als Beispiel an. Alle meine Tests sind aus dem gleichen Grund fehlgeschlagen, weshalb ich nur einen gemacht habe. Es hat nichts mit dem Passwort-Reset-Test an sich zu tun. also nicht duplizieren. – Owen

Antwort

0

fand ich das Problem:

die relationships.yml leer sein müssen, aber enthalten

one: 
    follower_id: 1 
    followed_id: 1 

two: 
    follower_id: 1 
    followed_id: 1 

kommentiert das Problem gelöst aus

Verwandte Themen