Skip to content

Instantly share code, notes, and snippets.

@somethvictory
Last active July 17, 2018 14:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save somethvictory/12a541bcafbe3d7f7ec483e646335027 to your computer and use it in GitHub Desktop.
Save somethvictory/12a541bcafbe3d7f7ec483e646335027 to your computer and use it in GitHub Desktop.
Group similar specs in the same describe block.
require 'rails_helper'
RSpec.describe Robot, 'Validations', type: :model do
it { is_expected.to validate_presence_of(:name) }
it { is_expected.to validate_presence_of(:color) }
end
RSpec.describe Robot, 'Associations', type: :model do
it { is_expected.to belong_to(:color) }
it { is_expected.to have_and_belong_to_many(:statuses) }
end
RSpec.describe Robot, 'Class Methods', type: :model do
# class methods specs go here...
end
RSpec.describe Robot, 'Instance Methods', type: :model do
# instance methods specs go here...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment