spec/emotions/emotional_spec.rb in emotions-0.2.2 vs spec/emotions/emotional_spec.rb in emotions-0.3

- old
+ new

@@ -65,11 +65,11 @@ describe :express! do let(:picture) { Picture.create } context 'with valid emotive and emotion' do - it { expect{ user.express! :happy, picture }.to change{ Emotions::Emotion.count }.from(0).to(1) } + it { expect{ user.express! :happy, picture }.to change{ Emotion.count }.from(0).to(1) } it { expect{ user.express! :happy, picture }.to change{ user.happy_about? picture }.from(false).to(true) } end context 'with invalid emotive' do it { expect{ user.express! :happy, user }.to raise_error(Emotions::InvalidEmotion) } @@ -83,11 +83,11 @@ describe :no_longer_express! do let(:picture) { Picture.create } before { user.happy_about!(picture) } context 'with valid emotive and emotion' do - it { expect{ user.no_longer_express! :happy, picture }.to change{ Emotions::Emotion.count }.from(1).to(0) } + it { expect{ user.no_longer_express! :happy, picture }.to change{ Emotion.count }.from(1).to(0) } it { expect{ user.no_longer_express! :happy, picture }.to change{ user.happy_about? picture }.from(true).to(false) } end context 'with invalid emotive' do it { expect{ user.no_longer_express! :happy, user }.to_not raise_error } @@ -116,12 +116,11 @@ describe :emotion_about! do let(:picture) { Picture.create } context 'with valid emotive' do - it { expect(user.happy_about! picture).to be_instance_of(Emotions::Emotion) } - it { expect{ user.happy_about! picture }.to change{ Emotions::Emotion.count }.from(0).to(1) } + it { expect{ user.happy_about! picture }.to change{ Emotion.count }.from(0).to(1) } it { expect{ user.happy_about! picture }.to change{ user.happy_about? picture }.from(false).to(true) } end context 'with invalid emotive' do it { expect{ user.happy_about! user }.to raise_error(Emotions::InvalidEmotion) } @@ -131,11 +130,10 @@ describe :no_longer_emotion_about! do before { user.happy_about!(picture) } let(:picture) { Picture.create } context 'with valid emotive' do - it { expect(user.no_longer_happy_about! picture).to be_instance_of(Emotions::Emotion) } - it { expect{ user.no_longer_happy_about! picture }.to change{ Emotions::Emotion.count }.from(1).to(0) } + it { expect{ user.no_longer_happy_about! picture }.to change{ Emotion.count }.from(1).to(0) } it { expect{ user.no_longer_happy_about! picture }.to change{ user.happy_about? picture }.from(true).to(false) } end context 'with invalid emotive' do it { expect(user.no_longer_happy_about! user).to be_nil }