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 'webmock/rspec' | |
RSpec.configure do |config| | |
WebMock.disable_net_connect! | |
require 'vcr' | |
VCR.config do |c| | |
c.cassette_library_dir = 'vcr_cassettes' | |
c.stub_with :webmock | |
c.default_cassette_options = { :record => :once } | |
end |
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
stub_request(:any, "api.twitter.com/followrs/count").with(:body=>'Hi') |
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
def followers_count(user) | |
c = Twitter.followers_count(user) | |
user.update_attribute(:followers_count, c) | |
end |
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
class Project < ActiveRecord::Base | |
after_create :send_create_notifications | |
private | |
def send_create_notifications | |
self.members.each do |member| | |
ProjectMailer.deliver_notification(self, member) | |
end | |
end | |
end |
NewerOlder