mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-09 07:28:41 -07:00
21 lines
585 B
Ruby
21 lines
585 B
Ruby
require 'rails_helper'
|
|
|
|
module Legacy
|
|
RSpec.describe District, type: :model do
|
|
let(:district1) { District.create(name: 'District one', state_id: 32) }
|
|
let(:district2) { District.new(name: 'District two', state_id: 32) }
|
|
|
|
context "when saving or creating" do
|
|
it 'should return a slug' do
|
|
expect(district1.slug).to eq 'district-one'
|
|
|
|
district2.save
|
|
expect(district2.slug).to eq 'district-two'
|
|
|
|
first_district = District.find_by_slug('district-one')
|
|
expect(first_district.slug).to eq 'district-one'
|
|
end
|
|
end
|
|
end
|
|
|
|
end
|