Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8479121
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:56:12+00:00 2026-06-10T18:56:12+00:00

The following code: describe Task do let(:task) { Task.new } subject { task }

  • 0

The following code:

describe Task do
  let(:task) { Task.new }
  subject { task }
  before(:each) do
    task.valid?
    p task.errors.full_messages
  end
  it { should have(1).error_on(:title) }
  it { should have(1).error_on(:description) }
end 

outputs: ["Title can't be blank", "Title can't be blank", "Title can't be blank"] and I can’t figure out any specific reason this would happen but the way I experiencing things is that let and subject don’t work very well lol

Even the following code produces the same errors:

  it "should have 1 error on title" do
    Task.new.should have(1).error_on(:title)
  end

  it "should have 1 error on description" do
    Task.new.should have(1).error_on(:description)
  end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T18:56:14+00:00Added an answer on June 10, 2026 at 6:56 pm

    The root of this issue was that some other spec was failing. When I got those specs passing this one did too. Very interesting.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting errors running the following code. I have provided comments to describe
Let's say that I have the following code in application_helper.rb : def do_something if
Can anyone help me to describe me following code line by line. protected override
Bear with me as I dump the following simplified code: (I will describe the
I have the following code in Python: def point_to_index(point): if point not in points:
I have following code like this in 'artists_helpers' class. def round_to(x) (self * 10**x).round.to_f
I have the following code in PhoneGap iPhone, in file Geofence.js Geofence.prototype.subscribeToLayer = function(layerName,circularRadius,successCallback){
I have some code in which I need to attach a new window page
I have an ArticleController with the following code : def edit @article = current_user.articles.find(params[:id])
I've a problem , as the following code discribe itself. 1 #include<stdlib.h> 2 #include<stdio.h>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.