blob: a46a528f7c6fb9f3802b922c61bb4169ed4d9a53 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
require 'rails_helper'
RSpec.describe Operation, type: :model do
let(:organisation) {
org = build(:organisation)
# Operation.create!(
# name: "MyString"
# )
}
# before(:each) do
# assign(:operation, operation)
# end
subject { described_class.new(name: "Spuds", organisation: organisation) }
describe "existence" do
it "exists!" do
expect(subject).to be_valid
end
end
describe "validations" do
it "is invalid without a name" do
subject.name = nil
expect(subject).to be_invalid
end
it "is invalid with a name longer than 35 chars" do
subject.name = "a" * 36
expect(subject).to be_invalid
end
end
end
|