Created
May 20, 2014 09:26
-
-
Save myobie/bca01fe59977a66ef413 to your computer and use it in GitHub Desktop.
This file contains 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 'spec_helper' | |
describe DiscussionsController do | |
before { stub_current_user } | |
describe "index" do | |
context "(with a project and some discussions)" do | |
before do | |
@project = create :project, owner: current_user, member_ids: [current_user.id] | |
@discussions = 3.times.map do | |
create :discussion, project: @project | |
end | |
end | |
describe "returns a list of discussions for the project" do | |
before { get :index, project_id: @project.id } | |
it { expect(response).to be_success } | |
it { expect(json_response.length).to eq(3) } | |
it "and are the type discussion" do | |
expect(json_response.first["type"]).to eq("discussion") | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment