title: Rspec test to check the value of created object
body: <p>I am a newbie to Rspec. I have written an rspec which checks the create action of a controller called "Lead controller". Now I want to write a spec which checks the attribute called "status" is set to "LEAD".I want to check it from post data from the app after creating the lead. How do I use 'expect' block and 'post :create' to check status?</p>
  
  <pre><code>describe 'POST #create' do
      it "should create a lead" do
        my_lead = Fabricate(:project, id:  Faker::Number.number(10))
        expect{
        post :create, project: my_lead.attributes
        }.to change(Project, :count).by(1)
      end
       it "should assign the status to lead" do
         my_lead = Fabricate(:project, id:  Faker::Number.number(10))
         my_lead.status.should == "LEAD"
       end
  
    end
  </code></pre>