specs to account for new default letter avatar location

This commit is contained in:
Sam 2015-09-15 13:25:15 +10:00
parent 24520937aa
commit 83efde79f0
3 changed files with 9 additions and 0 deletions

View File

@ -61,6 +61,7 @@ describe Onebox::Engine::DiscourseLocalOnebox do
end
it "returns some onebox goodness if post exists and can be seen" do
SiteSetting.external_system_avatars_enabled = false
url = "#{topic.url}"
Guardian.any_instance.stubs(:can_see?).returns(true)
html = Onebox.preview(url).to_s

View File

@ -27,6 +27,8 @@ describe TopicsController do
let!(:p2) { Fabricate(:post, topic: topic, user:user )}
it "returns the JSON in the format our wordpress plugin needs" do
SiteSetting.external_system_avatars_enabled = false
xhr :get, :wordpress, topic_id: topic.id, best: 3
expect(response).to be_success
json = ::JSON.parse(response.body)

View File

@ -896,7 +896,11 @@ describe User do
let(:user) { build(:user, username: 'Sam') }
it "returns a 45-pixel-wide avatar" do
SiteSetting.external_system_avatars_enabled = false
expect(user.small_avatar_url).to eq("//test.localhost/letter_avatar/sam/45/#{LetterAvatar.version}.png")
SiteSetting.external_system_avatars_enabled = true
expect(user.small_avatar_url).to eq("https://avatars.discourse.org/letter/s/5f9b8f/45.png")
end
end
@ -1070,6 +1074,8 @@ describe User do
describe "automatic avatar creation" do
it "sets a system avatar for new users" do
SiteSetting.external_system_avatars_enabled = false
u = User.create!(username: "bob", email: "bob@bob.com")
u.reload
expect(u.uploaded_avatar_id).to eq(nil)