Commit 65a738e6 authored by Jonne Haß's avatar Jonne Haß
Browse files

bump rspec-rails

parent 03680ef7
......@@ -263,7 +263,7 @@ end
group :development, :test do
# RSpec (unit tests, some integration tests)
gem "rspec-rails", "3.1.0"
gem "rspec-rails", "3.2.1"
# Cucumber (integration tests)
gem "cucumber-rails", "1.4.2", require: false
......
......@@ -571,28 +571,29 @@ GEM
roxml (3.1.6)
activesupport (>= 2.3.0)
nokogiri (>= 1.3.3)
rspec (3.1.0)
rspec-core (~> 3.1.0)
rspec-expectations (~> 3.1.0)
rspec-mocks (~> 3.1.0)
rspec-core (3.1.7)
rspec-support (~> 3.1.0)
rspec-expectations (3.1.2)
rspec (3.2.0)
rspec-core (~> 3.2.0)
rspec-expectations (~> 3.2.0)
rspec-mocks (~> 3.2.0)
rspec-core (3.2.2)
rspec-support (~> 3.2.0)
rspec-expectations (3.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
rspec-mocks (3.1.3)
rspec-support (~> 3.1.0)
rspec-rails (3.1.0)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 3.1.0)
rspec-expectations (~> 3.1.0)
rspec-mocks (~> 3.1.0)
rspec-support (~> 3.1.0)
rspec-support (3.1.2)
rspec-mocks (3.2.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.2.0)
rspec-rails (3.2.1)
actionpack (>= 3.0, < 4.3)
activesupport (>= 3.0, < 4.3)
railties (>= 3.0, < 4.3)
rspec-core (~> 3.2.0)
rspec-expectations (~> 3.2.0)
rspec-mocks (~> 3.2.0)
rspec-support (~> 3.2.0)
rspec-support (3.2.2)
rubocop (0.29.1)
astrolabe (~> 1.3)
parser (>= 2.2.0.1, < 3.0)
......@@ -795,7 +796,7 @@ DEPENDENCIES
responders (= 2.1.0)
roxml (= 3.1.6)
rspec-instafail (= 0.2.6)
rspec-rails (= 3.1.0)
rspec-rails (= 3.2.1)
rubocop (= 0.29.1)
ruby-oembed (= 0.8.12)
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
# 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
Capybara.register_driver :selenium do |app|
......
require 'spec_helper'
describe Reshare, :type => :model do
include Rails.application.routes.url_helpers
it 'has a valid Factory' do
expect(FactoryGirl.build(:reshare)).to be_valid
end
......@@ -207,7 +205,15 @@ describe Reshare, :type => :model do
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)
end
......@@ -235,7 +241,15 @@ describe Reshare, :type => :model do
context 'saving the post' do
before do
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
it 'fetches the root post from root_guid' do
......
......@@ -20,6 +20,8 @@ end
ProcessedImage.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
[local_luke, local_leia, remote_raphael]
......
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
def share_with(*args)
......@@ -22,7 +17,7 @@ class User
self.aspects.reload
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_post(p, dispatch_opts)
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment