Created
September 15, 2014 21:29
-
-
Save dobleuber/f8075ea338679846c1ba to your computer and use it in GitHub Desktop.
Test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rails_helper' | |
RSpec.describe PostsController, :type => :controller do | |
let(:fb_posts) { JSON.parse(File.read(Rails.root + "spec/support/fixtures/posts.json")) } | |
let(:fb_post) { fb_posts["feed"]["data"][0] } | |
describe "Get index" do | |
it "test get#index method" do | |
post = Post.create | |
get :index | |
expect(assigns(:posts)).to eq([post]) | |
end | |
it "test render method" do | |
get :index | |
expect(response).to render_template("index") | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment