Skip to content

Instantly share code, notes, and snippets.

@jcoyne
Created January 6, 2014 18:44
Show Gist options
  • Save jcoyne/8287438 to your computer and use it in GitHub Desktop.
Save jcoyne/8287438 to your computer and use it in GitHub Desktop.
DownloadsController spec
require 'spec_helper'
describe DownloadsController do
let(:technote) { Technote.new("title" => "MyString") }
let(:user) {User.create!(email: '[email protected]', password: 'drowssap')}
before do
sign_in user
technote.read_users = [user.user_key]
technote.technoteContent.content = "My ds content"
technote.save!
end
it "should go" do
get :show, id: technote, datastream_id: 'technoteContent'
expect(response).to be_successful
expect(response.body).to eq "My ds content"
end
end
@jcoyne
Copy link
Author

jcoyne commented Jan 6, 2014

Make sure your spec/spec_helper.rb has this line, so that sign_in is defined.

  config.include Devise::TestHelpers, :type => :controller

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment