2009-11-18 33 views
5

Chỉ cần để xóa không khí, tôi không phải là một số nhà máy độc ác chủ cố gắng để làm im lặng phụ nữ làm việc. Tôi đang gặp một vấn đề rất khó chịu khi sử dụng cô gái nhà máy của Thoughtbot trong thông số kỹ thuật của tôi, mỗi khi Factory.create (: foo) được sử dụng, cá thể mô hình ActiveRecord mới được tạo sẽ được ghi vào bàn điều khiển. Điều này làm cho việc xem xét đầu ra giao diện điều khiển của tôi khó khăn hơn để lọc ra toàn bộ quá trình ghi thêm. Có một thiết lập ở đâu đó hoặc một lá cờ có thể được thiết lập mà sẽ im lặng khai thác thêm này?Im lặng Nhà máy Cô gái đăng nhập

Dưới đây là ví dụ nhỏ về đầu ra rspec của tôi. Các '.' ở đầu mỗi dòng, trong trường hợp này, là một thử nghiệm thành công.

loading autotest/rspec 
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby /Library/Ruby/Gems/1.8/gems/rspec-1.2.9/bin/spec --autospec spec/publisher_spec.rb -O spec/spec.opts 
#<Event id: nil, oid: "mainEvent1", name: "Main Event", short_name: "mainevent", time_zone: "PST", created_at: nil, updated_at: nil, draft: true, draft_origin_id: nil, draft_deleted: false> 
#<Event id: nil, oid: "mainEvent1", name: "Main Event", short_name: "mainevent", time_zone: "PST", created_at: "2009-11-18 19:11:56", updated_at: "2009-11-18 19:11:56", draft: true, draft_origin_id: 3, draft_deleted: false> 
#<Event id: nil, oid: "bumbershoo", name: "Bumbershoot", short_name: "bumbershoot", time_zone: "PST", created_at: nil, updated_at: nil, draft: true, draft_origin_id: nil, draft_deleted: false> 
#<Notification id: nil, oid: "8P93CNEcl0", event_id: 3, name: "Penut Butter Jelly Time", url: nil, type: "Alert", priority: 10, last_displayed: "2009-11-16 19:11:54", format: nil, content: "IT'S PENUT BUTTER JELLY TIME. WHERE YOU AT? WHERE ...", image: nil, is_active: true, created_at: nil, updated_at: nil, updated_by: nil, image_file_name: nil, image_content_type: nil, image_file_size: nil, image_updated_at: nil, draft: true, draft_origin_id: nil, draft_deleted: false> 
#<Notification id: nil, oid: "8P93CNEcl0", event_id: 3, name: "Penut Butter Jelly Time", url: nil, type: "Alert", priority: 10, last_displayed: "2009-11-16 19:11:54", format: nil, content: "IT'S PENUT BUTTER JELLY TIME. WHERE YOU AT? WHERE ...", image: nil, is_active: true, created_at: "2009-11-18 19:11:57", updated_at: "2009-11-18 19:11:57", updated_by: nil, image_file_name: nil, image_content_type: nil, image_file_size: nil, image_updated_at: nil, draft: true, draft_origin_id: 3, draft_deleted: false> 
.#<Event id: nil, oid: "mainEvent1", name: "Main Event", short_name: "mainevent", time_zone: "PST", created_at: nil, updated_at: nil, draft: true, draft_origin_id: nil, draft_deleted: false> 
#<Event id: nil, oid: "bumbershoo", name: "Bumbershoot", short_name: "bumbershoot", time_zone: "PST", created_at: nil, updated_at: nil, draft: true, draft_origin_id: nil, draft_deleted: false> 
.#<Event id: nil, oid: "mainEvent1", name: "Main Event", short_name: "mainevent", time_zone: "PST", created_at: nil, updated_at: nil, draft: true, draft_origin_id: nil, draft_deleted: false> 
.#<Event id: nil, oid: "mainEvent1", name: "Main Event", short_name: "mainevent", time_zone: "PST", created_at: nil, updated_at: nil, draft: true, draft_origin_id: nil, draft_deleted: false> 
.#<Event id: nil, oid: "mainEvent1", name: "Main Event", short_name: "mainevent", time_zone: "PST", created_at: nil, updated_at: nil, draft: true, draft_origin_id: nil, draft_deleted: false> 

Tôi đã chọn thông số kỹ thuật của mình nhiều lần để xem tôi có "đặt foo.inspect" ở bất kỳ đâu không và tôi không. Điều này xảy ra cho tất cả các thử nghiệm rspec và dưa chuột của tôi bằng cách sử dụng các thử nghiệm tự động và thường chạy riêng lẻ.

Đây là tệp factories.rb của tôi có liên quan đến đầu ra ở trên. Lưu ý: có một số fanciness nhỏ xảy ra trong factories.rb của tôi.

[Cập nhật: 2009-11-20] Chỉ cố gắng giữ nội dung mới này và xem liệu người khác có thể có bất kỳ ý tưởng nào không.

+12

Bạn là chủ nhân tư bản độc tài! –

+0

Cập nhật: Vì một số lý do, điều này không còn là vấn đề nữa. Xem nếu bạn chờ đợi đủ lâu và không làm gì cả, mọi thứ sẽ tự khắc phục. Tôi ước gì tôi biết điều gì đã thay đổi để khắc phục vấn đề. –

Trả lời

2

Bạn có thể cung cấp thêm một số chi tiết về nơi chính xác bạn đang nhìn thấy các đường ghi không? Bạn đang chạy rake spec? Bạn có thể sao chép/dán một số ví dụ đầu ra?

+0

Tôi đã chỉnh sửa câu hỏi của mình bằng đoạn trích đầu ra rspec của tôi –

0

Tôi không biết làm thế nào hoặc tại sao, nhưng vấn đề này đã tự giải quyết được. Tôi chỉ có thể suy đoán rằng đó là bản cập nhật cho Factory Girl hoặc rspec. Có lẽ tôi đã xóa một số đăng nhập vào mã của mình. Tôi không thể chắc chắn.

Các vấn đề liên quan