docbrown/spec/services/article_with_video_creation_service_spec.rb
Mac Siri 2e647cedb4 Add more test coverage (#1829)
* Create github repos request spec

* Create article_mutes_spec.rb

* Create moderation_service_spec.rb

* Create push notification subscriptions spec

* Add PodcastEpisodeDecorator specs

* Remove randomness in test

* Create specs for ArticleWithVideoCreationService

* Update spec/decorators/podcast_episode_decorator_spec.rb

Co-Authored-By: maestromac <krairit.siri@gmail.com>
2019-02-22 09:16:57 -08:00

20 lines
646 B
Ruby

require "rails_helper"
RSpec.describe ArticleWithVideoCreationService, type: :service do
let(:link) { "https://s3.amazonaws.com/dev-to-input-v0/video-upload__2d7dc29e39a40c7059572bca75bb646b" }
before do
stub_request(:get, /cloudfront.net/).to_return(status: 200, body: "", headers: {})
end
describe "#create!" do
it "works" do
Timecop.travel(3.weeks.ago)
user = create(:user)
Timecop.return
test = build_stubbed(:article, user: user, video: link).attributes.symbolize_keys
article = described_class.new(test, user).create!
expect(article.video_state).to eq("PROGRESSING")
end
end
end