bump rspec-rails
This commit is contained in:
parent
03680ef718
commit
65a738e604
6 changed files with 46 additions and 32 deletions
2
Gemfile
2
Gemfile
|
|
@ -263,7 +263,7 @@ end
|
||||||
|
|
||||||
group :development, :test do
|
group :development, :test do
|
||||||
# RSpec (unit tests, some integration tests)
|
# RSpec (unit tests, some integration tests)
|
||||||
gem "rspec-rails", "3.1.0"
|
gem "rspec-rails", "3.2.1"
|
||||||
|
|
||||||
# Cucumber (integration tests)
|
# Cucumber (integration tests)
|
||||||
gem "cucumber-rails", "1.4.2", require: false
|
gem "cucumber-rails", "1.4.2", require: false
|
||||||
|
|
|
||||||
41
Gemfile.lock
41
Gemfile.lock
|
|
@ -571,28 +571,29 @@ GEM
|
||||||
roxml (3.1.6)
|
roxml (3.1.6)
|
||||||
activesupport (>= 2.3.0)
|
activesupport (>= 2.3.0)
|
||||||
nokogiri (>= 1.3.3)
|
nokogiri (>= 1.3.3)
|
||||||
rspec (3.1.0)
|
rspec (3.2.0)
|
||||||
rspec-core (~> 3.1.0)
|
rspec-core (~> 3.2.0)
|
||||||
rspec-expectations (~> 3.1.0)
|
rspec-expectations (~> 3.2.0)
|
||||||
rspec-mocks (~> 3.1.0)
|
rspec-mocks (~> 3.2.0)
|
||||||
rspec-core (3.1.7)
|
rspec-core (3.2.2)
|
||||||
rspec-support (~> 3.1.0)
|
rspec-support (~> 3.2.0)
|
||||||
rspec-expectations (3.1.2)
|
rspec-expectations (3.2.0)
|
||||||
diff-lcs (>= 1.2.0, < 2.0)
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
rspec-support (~> 3.1.0)
|
rspec-support (~> 3.2.0)
|
||||||
rspec-instafail (0.2.6)
|
rspec-instafail (0.2.6)
|
||||||
rspec
|
rspec
|
||||||
rspec-mocks (3.1.3)
|
rspec-mocks (3.2.1)
|
||||||
rspec-support (~> 3.1.0)
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
rspec-rails (3.1.0)
|
rspec-support (~> 3.2.0)
|
||||||
actionpack (>= 3.0)
|
rspec-rails (3.2.1)
|
||||||
activesupport (>= 3.0)
|
actionpack (>= 3.0, < 4.3)
|
||||||
railties (>= 3.0)
|
activesupport (>= 3.0, < 4.3)
|
||||||
rspec-core (~> 3.1.0)
|
railties (>= 3.0, < 4.3)
|
||||||
rspec-expectations (~> 3.1.0)
|
rspec-core (~> 3.2.0)
|
||||||
rspec-mocks (~> 3.1.0)
|
rspec-expectations (~> 3.2.0)
|
||||||
rspec-support (~> 3.1.0)
|
rspec-mocks (~> 3.2.0)
|
||||||
rspec-support (3.1.2)
|
rspec-support (~> 3.2.0)
|
||||||
|
rspec-support (3.2.2)
|
||||||
rubocop (0.29.1)
|
rubocop (0.29.1)
|
||||||
astrolabe (~> 1.3)
|
astrolabe (~> 1.3)
|
||||||
parser (>= 2.2.0.1, < 3.0)
|
parser (>= 2.2.0.1, < 3.0)
|
||||||
|
|
@ -795,7 +796,7 @@ DEPENDENCIES
|
||||||
responders (= 2.1.0)
|
responders (= 2.1.0)
|
||||||
roxml (= 3.1.6)
|
roxml (= 3.1.6)
|
||||||
rspec-instafail (= 0.2.6)
|
rspec-instafail (= 0.2.6)
|
||||||
rspec-rails (= 3.1.0)
|
rspec-rails (= 3.2.1)
|
||||||
rubocop (= 0.29.1)
|
rubocop (= 0.29.1)
|
||||||
ruby-oembed (= 0.8.12)
|
ruby-oembed (= 0.8.12)
|
||||||
sass-rails (= 5.0.1)
|
sass-rails (= 5.0.1)
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,9 @@ require 'capybara/session'
|
||||||
#require 'cucumber/rails/capybara_javascript_emulation' # Lets you click links with onclick javascript handlers without using @culerity or @javascript
|
#require 'cucumber/rails/capybara_javascript_emulation' # Lets you click links with onclick javascript handlers without using @culerity or @javascript
|
||||||
|
|
||||||
# Ensure we know the appservers port
|
# Ensure we know the appservers port
|
||||||
Capybara.server_port = 9887
|
Capybara.server_port = AppConfig.pod_uri.port
|
||||||
|
Rails.application.routes.default_url_options[:host] = AppConfig.pod_uri.host
|
||||||
|
Rails.application.routes.default_url_options[:port] = AppConfig.pod_uri.port
|
||||||
|
|
||||||
# Use a version of Firefox defined by environment variable, if set
|
# Use a version of Firefox defined by environment variable, if set
|
||||||
Capybara.register_driver :selenium do |app|
|
Capybara.register_driver :selenium do |app|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe Reshare, :type => :model do
|
describe Reshare, :type => :model do
|
||||||
include Rails.application.routes.url_helpers
|
|
||||||
|
|
||||||
it 'has a valid Factory' do
|
it 'has a valid Factory' do
|
||||||
expect(FactoryGirl.build(:reshare)).to be_valid
|
expect(FactoryGirl.build(:reshare)).to be_valid
|
||||||
end
|
end
|
||||||
|
|
@ -207,7 +205,15 @@ describe Reshare, :type => :model do
|
||||||
|
|
||||||
allow(@response).to receive(:body).and_return(@root_object.to_diaspora_xml)
|
allow(@response).to receive(:body).and_return(@root_object.to_diaspora_xml)
|
||||||
|
|
||||||
expect(Faraday.default_connection).to receive(:get).with(URI.join(@original_author.url, short_post_path(@root_object.guid, :format => "xml"))).and_return(@response)
|
expect(Faraday.default_connection).to receive(:get).with(
|
||||||
|
URI.join(
|
||||||
|
@original_author.url,
|
||||||
|
Rails.application.routes.url_helpers.short_post_path(
|
||||||
|
@root_object.guid,
|
||||||
|
format: "xml"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
).and_return(@response)
|
||||||
Reshare.from_xml(@xml)
|
Reshare.from_xml(@xml)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -235,7 +241,15 @@ describe Reshare, :type => :model do
|
||||||
context 'saving the post' do
|
context 'saving the post' do
|
||||||
before do
|
before do
|
||||||
allow(@response).to receive(:body).and_return(@root_object.to_diaspora_xml)
|
allow(@response).to receive(:body).and_return(@root_object.to_diaspora_xml)
|
||||||
allow(Faraday.default_connection).to receive(:get).with(URI.join(@reshare.root.author.url, short_post_path(@root_object.guid, :format => "xml"))).and_return(@response)
|
allow(Faraday.default_connection).to receive(:get).with(
|
||||||
|
URI.join(
|
||||||
|
@reshare.root.author.url,
|
||||||
|
Rails.application.routes.url_helpers.short_post_path(
|
||||||
|
@root_object.guid,
|
||||||
|
format: "xml"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
).and_return(@response)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'fetches the root post from root_guid' do
|
it 'fetches the root post from root_guid' do
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,8 @@ end
|
||||||
|
|
||||||
ProcessedImage.enable_processing = false
|
ProcessedImage.enable_processing = false
|
||||||
UnprocessedImage.enable_processing = false
|
UnprocessedImage.enable_processing = false
|
||||||
|
Rails.application.routes.default_url_options[:host] = AppConfig.pod_uri.host
|
||||||
|
Rails.application.routes.default_url_options[:port] = AppConfig.pod_uri.port
|
||||||
|
|
||||||
def set_up_friends
|
def set_up_friends
|
||||||
[local_luke, local_leia, remote_raphael]
|
[local_luke, local_leia, remote_raphael]
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,4 @@
|
||||||
class User
|
class User
|
||||||
include Rails.application.routes.url_helpers
|
|
||||||
def default_url_options
|
|
||||||
{:host => AppConfig.pod_uri.host}
|
|
||||||
end
|
|
||||||
|
|
||||||
alias_method :share_with_original, :share_with
|
alias_method :share_with_original, :share_with
|
||||||
|
|
||||||
def share_with(*args)
|
def share_with(*args)
|
||||||
|
|
@ -22,7 +17,7 @@ class User
|
||||||
self.aspects.reload
|
self.aspects.reload
|
||||||
|
|
||||||
add_to_streams(p, aspects)
|
add_to_streams(p, aspects)
|
||||||
dispatch_opts = {:url => post_url(p), :to => opts[:to]}
|
dispatch_opts = {url: Rails.application.routes.url_helpers.post_url(p), to: opts[:to]}
|
||||||
dispatch_opts.merge!(:additional_subscribers => p.root.author) if class_name == :reshare
|
dispatch_opts.merge!(:additional_subscribers => p.root.author) if class_name == :reshare
|
||||||
dispatch_post(p, dispatch_opts)
|
dispatch_post(p, dispatch_opts)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue