diff options
author | re4k <re4k@re4k.info> | 2013-04-28 00:39:24 +0900 |
---|---|---|
committer | re4k <re4k@re4k.info> | 2013-04-28 00:39:24 +0900 |
commit | 617c786764e4c10d85c87945a6c281061e65dcc8 (patch) | |
tree | 35fb1aa1ec5c29afc1a6759b05f7802fa7c47849 /spec | |
parent | a470a57e298ca637f860d2ae9f2d2c1d777b48e1 (diff) | |
download | aclog-617c786764e4c10d85c87945a6c281061e65dcc8.tar.gz |
fix spec
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/account_spec.rb | 9 | ||||
-rw-r--r-- | spec/models/tweet_spec.rb | 8 | ||||
-rw-r--r-- | spec/models/user_spec.rb | 36 |
3 files changed, 8 insertions, 45 deletions
diff --git a/spec/models/account_spec.rb b/spec/models/account_spec.rb index 4984b94..767dc24 100644 --- a/spec/models/account_spec.rb +++ b/spec/models/account_spec.rb @@ -31,7 +31,6 @@ describe Account do context "when exist" do before { @user = FactoryGirl.create(:user_1) } - it { should_not eq nil } it { should eq @user } end @@ -40,6 +39,14 @@ describe Account do end end + describe "#update_connection" do + let(:account) { FactoryGirl.create(:account_1) } + it "should not raise error" do + expect { account.update_connection }.not_to raise_error + end + # TODO: how to test receiver...? + end + describe "#client" do let(:account) { FactoryGirl.create(:account_1) } subject { account.client } diff --git a/spec/models/tweet_spec.rb b/spec/models/tweet_spec.rb index 25bff25..a6afb01 100644 --- a/spec/models/tweet_spec.rb +++ b/spec/models/tweet_spec.rb @@ -31,14 +31,6 @@ describe Tweet do its(:retweets_count) { should be subject.retweets.count } end - describe ".cached" do - subject { Tweet.cached(@tweet_0_0) } - its(:id) { should be @tweet_0_0.id } - its(:text) { should eq @tweet_0_0.text } - its(:source) { should eq @tweet_0_0.source } - its(:user) { should eq @tweet_0_0.user } - end - describe ".delete_from_id" do context "when of tweet" do subject { Tweet.delete_from_id(@tweet_1_0.id) } diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index f595fea..ee6c724 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -1,42 +1,6 @@ require 'spec_helper' describe User do - describe ".cached" do - let(:user) { FactoryGirl.create(:user_1) } - - shared_examples_for "cached_exists" do - its(:id) { should be user.id } - its(:screen_name) { should eq user.screen_name } - its(:name) { should eq user.name } - its(:profile_image_url) { should eq user.profile_image_url } - its(:protected) { should be user.protected } - end - - context "when exists" do - describe "user_id" do - subject { User.cached(user.id) } - it_behaves_like("cached_exists") - end - - context "screen_name" do - subject { User.cached(user.screen_name) } - it_behaves_like("cached_exists") - end - end - - context "when not exists" do - describe "user_id" do - subject { User.cached(-1) } - it { should be nil } - end - - context "screen_name" do - subject { User.cached("me") } - it { should be nil } - end - end - end - describe ".from_user_object" do context "when not recorded" do let(:user_1_model) { FactoryGirl.build(:user_1) } |