@@ -6,15 +6,16 @@ describe CreationTagsController do
let(:user) { create(:user) }
before :each do
- user.tag(cake, :with => "cake", :on => :tags)
+ user.tag(cake, with: "cake", on: :tags)
get :index
end
it "should load all the tags" do
- assigns(:tags).count.should == 1
- assigns(:tags).first.name.should == "cake"
+ expect(assigns(:tags).count).to eql(1)
+ expect(assigns(:tags).first.name).to eql("cake")
end
end
+
describe "#show" do
let(:user) { create(:user) }
let(:tag) { "cake" }
@@ -24,21 +25,21 @@ describe CreationTagsController do
let(:untagged_cake) { create(:creation) }
before :each do
- user.tag(tagged_tutorial, :with => tag, :on => :tags)
- user.tag(tagged_cake, :with => tag, :on => :tags)
+ user.tag(tagged_tutorial, with: tag, on: :tags)
+ user.tag(tagged_cake, with: tag, on: :tags)
get :show, id: tag
end
it "should return each cake that is tagged" do
- assigns(:creations).should include(tagged_cake)
+ expect(assigns(:creations)).to include(tagged_cake)
end
it "should not return cakes that are not tagged" do
- assigns(:creations).should_not include(untagged_cake)
+ expect(assigns(:creations)).to_not include(untagged_cake)
end
it "should include the tag" do
- assigns(:tag).should == tag
+ expect(assigns(:tag)).to eql(tag)
end
end
end