<commit_before>//
//  ElloAPISpec.swift
//  Ello
//
//  Created by <NAME> on 11/22/14.
//  Copyright (c) 2014 Ello. All rights reserved.
//

import Foundation

import Ello
import Quick
import Moya
import Nimble


class ElloAPISpec: QuickSpec {
    override func spec() {

        var provider: MoyaProvider<ElloAPI>!

        beforeEach {
            provider = ElloProvider.StubbingProvider()
        }

        afterEach {
            provider = ElloProvider.DefaultProvider()
        }

        describe("DiscoverType") {
            describe("name") {
                it("is correct for each case") {
                    expect(DiscoverType.Recommended.name) == "Featured"
                    expect(DiscoverType.Trending.name) == "Trending"
                    expect(DiscoverType.Recent.name) == "Recent"
                }
            }
        }

        describe("ElloAPI") {
            describe("paths") {

                context("are valid") {
                    it("AmazonCredentials is valid") {
                        expect(ElloAPI.AmazonCredentials.path) ==  "/api/v2/assets/credentials"
                    }
                    it("Auth is valid") {
                        expect(ElloAPI.Auth(email: "", password: "").path) == "/api/oauth/token"
                    }
                    it("Availability is valid") {
                        expect(ElloAPI.Availability(content: [:]).path) == "/api/v2/availability"
                    }
                    it("AwesomePeopleStream is valid") {
                        expect(ElloAPI.AwesomePeopleStream.path) == "/api/v2/discover/users/onboarding"
                    }
                    it("CommunitiesStream is valid") {
                        expect(ElloAPI.CommunitiesStream.path) == "/api/v2/interest_categories/members"
                    }
                    it("CreatePost is valid") {
                        expect(ElloAPI.CreatePost(body: [:]).path) == "/api/v2/posts"
                    }
                    it("Discover is valid") {
                        expect(ElloAPI.Discover(type: DiscoverType.Recommended, perPage: 5).path) == "/api/v2/discover/users/recommended"
                    }<commit_msg>Update API endpoints for new discover streams.<commit_after>//
//  ElloAPISpec.swift
//  Ello
//
//  Created by <NAME> on 11/22/14.
//  Copyright (c) 2014 Ello. All rights reserved.
//

import Foundation

import Ello
import Quick
import Moya
import Nimble


class ElloAPISpec: QuickSpec {
    override func spec() {

        var provider: MoyaProvider<ElloAPI>!

        beforeEach {
            provider = ElloProvider.StubbingProvider()
        }

        afterEach {
            provider = ElloProvider.DefaultProvider()
        }

        describe("DiscoverType") {
            describe("name") {
                it("is correct for each case") {
                    expect(DiscoverType.Recommended.name) == "Featured"
                    expect(DiscoverType.Trending.name) == "Trending"
                    expect(DiscoverType.Recent.name) == "Recent"
                }
            }
        }

        describe("ElloAPI") {
            describe("paths") {

                fcontext("are valid") {
                    it("AmazonCredentials is valid") {
                        expect(ElloAPI.AmazonCredentials.path) ==  "/api/v2/assets/credentials"
                    }
                    it("Auth is valid") {
                        expect(ElloAPI.Auth(email: "", password: "").path) == "/api/oauth/token"
                    }
                    it("Availability is valid") {
                        expect(ElloAPI.Availability(content: [:]).path) == "/api/v2/availability"
                    }
                    it("AwesomePeopleStream is valid") {
                        expect(ElloAPI.AwesomePeopleStream.path) == "/api/v2/discover/users/onboarding"
                    }
                    it("CommunitiesStream is valid") {
                        expect(ElloAPI.CommunitiesStream.path) == "/api/v2/interest_categories/members"
                    }
                    it("CreatePost is valid") {
                        expect(ElloAPI.CreatePost(body: [:]).path) == "/api/v2/posts"
                    }
                    it("Discover.Recommended is valid") {
                        expect(ElloAPI.Discover(type: DiscoverType.Recommended, perPage: 5).path) == "/api/v2/discover/posts/recommended"
                    }
                    it("Discover.Trending is valid") {
                        expect(ElloAPI.Discover(type: DiscoverType.Trending, perPage: 5).path) == "/api/v2/discover/users/recommended"
                    }
                    it("Discover.Recent is valid") {
                        expect(ElloAPI.Discover(type: DiscoverType.Recent, perPage: 5).path) == "/api/v2/discover/posts/recommended"
                    }
{'fraction_non_alphanumeric': 0.1168724279835391, 'fraction_numerical': 0.007818930041152264, 'mean_word_length': 1.4220229197807672, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4020806', 'n_tokens_mistral': 1405, 'n_tokens_neox': 1251, 'n_words': 220}