Rspec for scopes in rails



 describe "Scopes" do
      it "should be active with status_id 3" do
      User.active.should include(@user)
      end

      it "should not be suspended without status_id 4" do
          User.suspended.should_not include(@user)
      end

      it "should not be inactive without status_id 5" do
          User.inactive.should_not include(@user)
      end

      it "should not be hidden without status_id 6" do
          User.hidden.should_not include(@user)
      end

      it "should not be deleted without status_id 7" do
          User.deleted.should_not include(@user)
      end
  end

Comments

Popular Posts

How to pass hash in Postman

nginx: unrecognized service

Reading Excel Sheets using "Roo" gem in ruby on rails

Bootstrap Select Picker append add new item if search not exist

Add CORS to Nginx on AWS Elastic Beanstalk

Enable gzip compression on Elastic Beanstalk with nginx

Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'

Get video duration by URL in Ruby on Rails

site-enables nginx setting in ruby in rails