Skip to content

Instantly share code, notes, and snippets.

@gregblake
Created March 12, 2018 19:48
Show Gist options
  • Select an option

  • Save gregblake/555878a6e779d2cf303c7c418b70471d to your computer and use it in GitHub Desktop.

Select an option

Save gregblake/555878a6e779d2cf303c7c418b70471d to your computer and use it in GitHub Desktop.
nitro-web/components/core_models/spec/models/media_item_spec.rb
require "rails_helper"
describe MediaItem, ldap: :stub do
describe "validations" do
describe "#attachment" do
context "when there is a device" do
let(:device) { build_stubbed(:mobile_device) }
let(:media_item) { build_stubbed(:media_item, device: device) }
it "should be valid" do
expect(media_item).to be_valid
end
end
context "when there is no device" do
let(:media_item) { build_stubbed(:media_item) }
it "should not be valid" do
expect(media_item).to_not be_valid
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment