Benito Serna
Trying to build software that works

Did you finish the exercise?… Well here is my answer =)

describe "All documents..." do
  it "returns all documents" do
    store = store_with([
      document_with(file_url: "path/to_url/Doc-1.xls"),
      document_with(file_url: "path/to_url/Doc-2.xls")

    docs = Docs.all_documents(store)
    expect(docs.count).to eq 2

  it "has each document with..." do
    store = store_with([
        file_url: "path/to_url/Doc-1.xls",
        uploaded_at:, 10, 3),
        uploader: user_with(
          name: "Benito Serna",
          photo_url: "path/to/user/1/photo.png"

    doc = Docs.all_documents(store).first
    expect(doc.icon_type).to eq "xls"
    expect(doc.file_name).to eq "Doc-1.xls"
    expect(doc.uploader_photo_url).to eq "path/to/user/1/photo.png"
    expect(doc.uploader_name).to eq "Benito Serna"
    expect(doc.uploaded_at).to eq, 10, 3)

Do you need some help with TDD?

I have an email course with with a guide to help you start with TDD!

Do you want to know more?